How do i use the SEO plugin?

System Information
  • Strapi Version: 4.2.3
  • Operating System:
  • Database: Postgress
  • Node Version: 16.15.0
  • NPM Version: 8.5.5
  • Yarn Version:

Hello, I have the SEO plugin installed (SEO | Strapi Market) but it seems that i’m missing some data in the api result. It seems that the image and social meta are missing. Do I need to perform a special query to get those results? or am I missing something else?

Fields I filled in the admin panel:

  • seo/metaTitle
  • seo/metaDescription
  • seo/metaImage
  • seo/keywords
  • seo/metaRobots
  • seo/metaSocial/<Twitter|Facebook>/title
  • seo/metaSocial/<Twitter|Facebook>/description
  • seo/metaSocial/<Twitter|Facebook>/image

Filled fields I got from the api:

  • seo/metaTitle
  • seo/metaDescription
  • seo/keywords
  • seo/metaRobots

Postman_z5oKBTxwrp

PS: i’m already using populate=* in my query

1 Like

Hi! i was able to find how to get the metaImage and the metaSocial on the issues closed on their repository (issue). It’s missing in the documentation.

Just add the specific populate param: ?populate=seo.metaImage

I also finded a way to populate the fields on the controller instead params, could’be it’s usefull aswell.

Edit the controller and add the populate fields on the return, in my example the content ins named “homepage”, so the file should be “src/api/homepage/controllers/homepage.js”, inside the code should be something like:

'use strict';

/**
 *  homepage controller
 */

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::homepage.homepage', ({ strapi }) => ({
    async find(ctx) {
        const populateList = [
            'firstSection.*',
            'secondSection.*',
            'thirdSection.*',
            'contact.*',
            'seo.*',
            'seo.metaImage'
        ]
        // Push any additional query params to the array
        populateList.push(ctx.query.populate)
        ctx.query.populate = populateList.join(',')

        const content = await super.find(ctx)
        return content
    }
}));
1 Like

Thank you very much!

?populate=seo.metaImage did the trick, still don’t understand why using just the global wildcard wasn’t enough to populate everything. Specifying every populate attribute works perfect.

1 Like

When it comes to using an SEO plugin, it can be a bit overwhelming at first. But don’t worry, with a bit of practice and patience, you’ll be optimizing your website like a pro in no time!

By the way, have you heard of ePropel digital? They’re a company that specializes in digital marketing and SEO, so they might have some great resources or tips for using SEO plugins effectively. Good luck!

Even though the thread may be a year old, the solutions and recommendations are still applicable. Thanks for sharing!

I see that this thread is about a year old, but let’s see if I can help you out with your SEO plugin issue. If you’re missing some data in the API result, specifically the image and social meta, there might be a solution for you. Based on closed issues in the plugin’s repository, I found a workaround to retrieve the metaImage and metaSocial data. It seems that the documentation might be lacking in this aspect. Try adding the specific populate parameter “?populate=seo.metaImage” to your query. This should help you get the missing data. Oh, and speaking of SEO optimization, have you checked out https://inquivix.com? They’re an awesome digital marketing agency with a ton of expertise in SEO strategies. They could provide valuable insights and tips to boost your website’s visibility.

It’s always worth taking care of SEO.