How to create a meta-description on the main page when it's not listed as page?

#15495
Viewing 11 replies - 1 through 11 (of 11 total)
  • Hello,

    Thank you for contacting Rank Math today.

    If the custom page is listed as the homepage on Admin > Settings > Reading >
    Your homepage displays
    then you can target it using the following code on your theme’s functions.php file:

    /**
     * Allow changing the meta description sentence from within the theme.
     *
     * @param string $description The description sentence.
     */
    add_filter( 'rank_math/frontend/description', function( $description ) {
            if(is_front_page()){
            $description = "This is my custom description";
            return $description;
            }
    	return $description;
    });

    Looking forward to helping you. Thank you.

    ​​​​​​

    That’s the case, the homepage of https://sestraherbalismo.com.br isn’t actually a register inside WordPress, but it’s procedurally created by the ShopIsle Theme, ie, it’s created “on fly”.
    How could I control SEO attributes with this kind of page (inexisting inside WordPress)?

    Hello,

    Thank you for contacting Rank Math today.

    The conditional check should be able to work for this kind of page as well.
    ​​​​​​
    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hi there,

    Thanks for the access.

    I can see that you have already configured a custom meta description from the Rank Math UI on this page Rank Math > Titles & Meta > Homepage.
    Is there any reason that you do not want to modify the description from this section?

    We are looking forward to helping you. Thank you.

    How can I confirm that this homepage is SEO friendly?

    Hi Rogerio,

    Thanks for the question.

    The sitewide SEO audit will analyse all the content across your site including the homepage and give a recommendation.
    To be able to perform content analysis tests on the homepage content, you can also copy over the content to a new page on the backend to check the kind of tests that it passes and the ones that it fails and later delete it once you have optimized it.

    I hope this info helps. Thank you.

    My ask is, how could I change the homepage meta if it’s not listed as a page, but it’s created, as I said, by the theme, procedurally?

    Hi Rogerio,

    Thanks for the question.

    Your site is configured to list the current posts on the homepage and even though this is not technically a page, you can create custom meta from the Rank Math global settings page Rank Math > Titles & Meta > Homepage.

    I can suggest that you inspect the page source to check that the meta entered on this location is added to the homepage. https://tinyurl.com/yxjx92qd

    I hope this info helps. Thank you.

    It’s perfect, thank you very much!

    Hello,

    I am glad that this information proved helpful 🙂

    Feel free to contact us for any other questions, comments or suggestions. Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)

The ticket ‘How to create a meta-description on the main page when it's not listed as page?’ is closed to new replies.