Tagged: 

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #1208326

    Hi, I’ve just switched from Yoast to Rank Math as an SEO plugin, and the Rank Math feature to index category pages doesn’t work. I’ve disabled all plug ins and see that Enfold tags category pages as noindex. I’ve found a thread on here with suggested code to ad to the functions.php file, but this causes a critical error on my site (“There has been a critical error on your website.”). Any ideas?

    #1209988

    Hey edgold,

    Thank you for the inquiry.

    You can use this filter to adjust the meta tag in the archive or category pages.

    if(!function_exists('avia_archive_set_follow'))
    {
        function avia_archive_set_follow($meta)
        {
            if( is_product_category() || is_shop() || is_archive() ) {
                $meta = '<meta name="robots" content="index, follow" />' . "\n";
            }
            return $meta;
        }
    
        add_filter('avf_set_follow','avia_archive_set_follow', 10, 1);
    }
    

    Best regards,
    Ismael

    #1212117

    Hi,

    I have the same problem with SmartCrawl Pro.
    Thanks for this answer where we have to put these lines? in wp-includes/functions.php? but at what line or in which function?

    Thanks for the clarification

    #1212294

    Hi premaccess,

    You can put this code in your child theme functions.php.

    Best regards,
    Victoria

    #1212586

    Ok i did it but crashing the website with critical error… what can i do ?

    #1212855

    Hi premaccess,

    Please send us a temporary WordPress admin login and login URL so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Do we have permission to add the code to your site? Do you have backups of the site?

    Best regards,
    Rikard

    #1212904
    This reply has been marked as private.
    #1213187

    Hi premaccess,

    Thanks for that, the login details are not working though:

    Identifiant inconnu. Vérifiez l’orthographe ou essayez avec votre adresse e-mail.
    3 login attempts remaining

    Please check and verify.

    Best regards,
    Rikard

    #1213204
    This reply has been marked as private.
    #1213558

    Hi premaccess,

    The login details work now, but you don’t have the Editor function active under Appearance in the WordPress menu. Please include FTP login details in private as well so that we can add it manually to your site.

    Best regards,
    Rikard

    #1217553
    This reply has been marked as private.
    #1218120

    Hi premaccess,

    Thanks for that. I added a modified version to your functions.php file, since you don’t have WooCommerce installed:

    if(!function_exists('avia_archive_set_follow'))
    {
        function avia_archive_set_follow($meta)
        {
            if( is_archive() ) {
                $meta = '<meta name="robots" content="index, follow" />' . "\n";
            }
            return $meta;
        }
    
        add_filter('avf_set_follow','avia_archive_set_follow', 10, 1);
    }

    Best regards,
    Rikard

    #1218205

    Ok Thanks a lot
    Have a great weekend

    #1218620

    Hi,

    Thanks for the update, please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

    #1231858

    Hey guys, I tried all solutions provided in the forum but none seems to be working with my website. Same problem, I moved from Yoast to Rank Math and now all the categories are marked no index.

    Basically there are two robots meta tag one says NoIndex and Follow while other says index and follow

    <head>
    <meta charset="UTF-8" />
    <meta name="robots" content="noindex, follow" />
    
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <title>Sustainable Travel Archives | CuddlyNest</title>
    <meta name="robots" content="follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large" />
    <link rel="canonical" href="https://www.cuddlynest.com/blog/category/sustainable-travel/" />

    Please help.

    #1232262

    Hi,

    The other meta tag is probably added by a plugin or a custom script. If you need to disable the default meta tag from the theme, try to use this filter instead.

    
        function avia_archive_set_follow($meta)
        {
            return "";
        }
    
        add_filter('avf_set_follow','avia_archive_set_follow', 10, 1);
    

    Best regards,
    Ismael

    • This reply was modified 4 years, 4 months ago by Ismael. Reason: adjusted filter
    #1232276

    Hi Ismael,

    It didn’t do anything.

    I updated the functions.php file but I can still see noindex tag there.

    What shall I do?

    Thanks,

    Aditya

    #1233381

    Hi,

    Sorry for the delay. We adjusted the above filter a bit. Please disable the cache and minification plugins, then try to add the code again.

    Best regards,
    Ismael

Viewing 18 posts - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.