How to SEO a Next Js Website Using Strapi's SEO Plugin

Hello, I’m doing the SEO of a site made in Next Js 13 already using the APP directory instead of pages and I wanted to use the Strapi plugin to do the SEO, I have some static pages like HOME, ABOUT US and I wanted to know the best way to pull the SEO info into NEXT, would using the export async function generateMetadata() be the best way to do this? is it indicated for routes that are not dynamic? Sorry if it’s hard to understand, I’m using Google Translate

1 Like

I used to call the SEO information from the API, but I don’t know how new API does work.

To SEO optimize your Next Js site using Strapi’s plugin, you’re on the right track with the export async function generateMetadata(). It’s a great way to pull SEO info for static pages like HOME and ABOUT US. For non-dynamic routes, it’s an ideal choice. Just make sure to set up your metadata, title, description, and keywords for each page in the export function. Using Strapi’s plugin will help you streamline your SEO efforts and boost your site’s visibility. For dental practices, considering dental SEO services can further enhance your online presence and attract more targeted traffic to your site.

This function allows you to dynamically generate metadata for your pages, including SEO information. For static routes, it’s a convenient way to fetch the necessary data during the build process. You can utilize this function in your pages to fetch SEO-related information from Strapi and include it in the head of your HTML document.

Here’s a basic example of how you might structure the generateMetadata function:

Screenshot 2024-01-01 152413

You can customize this function based on your Strapi data structure and the information you want to include in the SEO metadata. Remember to replace ‘home’ with the appropriate page name.

Once implemented, Next.js will use this function during the build process to generate metadata for your static pages, improving their SEO. If you have any further questions or need clarification, feel free to ask!

Why do we need to import a function directly from the SEO plugin? Isn’t it possible to do by requesting the usual API?