Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #963047

    Hi Enfold team!

    Can you please show me how to remove the “noindex” meta tag on archives, tags and category pages and change them to “index”?

    Pages like these have this command line <meta name=”robots” content=”noindex,follow”/>

    https://crackerjackmarketing.com/blog/2015/12/
    https://crackerjackmarketing.com/blog/tag/twitter-parties/

    I would like to remove the noindex tag and change it to index for Google.

    Thanks!

    • This topic was modified 6 years, 11 months ago by Archie.
    #963280

    Hey hackoffseries,

    Try adding this css code in Quick CSS (located in Enfold > General Styling): code at the bottom of functions.php:

    add_filter('avf_set_follow','avia_set_follow');
    function avia_set_follow(){
      $meta = '<meta name="robots" content="index, follow" />' . "\n";
      return $meta;
    }

    Hope it helps :)

    Best regards,
    Nikko

    • This reply was modified 6 years, 11 months ago by Nikko.
    #963387

    Hey Nikko!

    Thank you for your response. I added the code you sent, but it seems like the “noindex” command is still there?

    view-source:https://crackerjackmarketing.com/blog/tag/social-media/
    view-source:https://crackerjackmarketing.com/blog/2011/11/

    I’ve already purged all cache on the site but still do not see any changes. Please advice.

    Thanks! :)

    • This reply was modified 6 years, 11 months ago by Archie.
    #964023

    Hi hackoffseries,

    I apologize for my mistake, it’s not supposed to be in Quick CSS, but at the bottom of functions.php, however it wouldn’t work since you are using Yoast SEO, you can modify it using the plugin settings in yoast, for more information please check this post: https://yoast.com/wordpress/plugins/seo/yoast-seo-robots-meta-configuration/
    Hope it helps.

    Best regards,
    Nikko

    #964033

    Thank you for that information Nikko! :)

    #964398

    Hi hackoffseries,

    Glad that we could help :)
    Let us know if you need further assistance.

    Best regards,
    Nikko

    #997454

    Hi,
    This code sets everything to Index, tags and archives too. It overides the settings in AIO SEO Plugin.
    Is it possible to only set the product categories to index, but keep the archives and tags to noindex?

    Thanks!

    #997551

    Hi Opmaxandi,

    You can try limiting the code with this function:
    https://wordpress.stackexchange.com/questions/306513/use-is-product-category-properly

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #997890

    Hi Victoria,

    If I understand this correctly, I should extend Nikko’s Code with:
    is_product_category(‘category-slug1′,’category-slug2’)

    Or should I put it before the code snippet? Sorry I don’t know PHP, so it’s just a guess…

    Regards

    #998192

    Hi,

    add_filter('avf_set_follow','avia_set_follow');
    function avia_set_follow(){
    if is_product_category(‘category-slug1′,’category-slug2’) {
      $meta = '<meta name="robots" content="index, follow" />' . "\n";
      return $meta;
    }
    }

    It should be something like that :)

    Best regards,
    Basilis

    #998374

    Hi Basilis,
    I tried that, but it returns an error:
    syntax error, unexpected 'is_product_category' (T_STRING), expecting '('

    #998421

    Hi,

    Please use this code instead:

    
    add_filter('avf_set_follow','avia_set_follow_product_cats', 10, 1);
    function avia_set_follow_product_cats($meta)
    {
    	if (is_product_category(array( 'shirts', 'games' ))) 
    	{
    	  $meta = '<meta name="robots" content="index, follow" />' . "\n";
    	}
    	return $meta;
    }
    

    and replace shirts and games with your category slugs. You can add more slugs, just separate them with a comma.

    Best regards,
    Dude

    #998513

    Hey Dude!
    Seems to be working!
    Thanks, you’re a rockstar – I owe you a white russian ;)

    #998516

    Hey!

    Great, glad it works now :)

    Cheers!
    Peter

    #1275563

    Hi,
    how can I edit singularly the tag and decide one by one if noindex or follow?
    Thanks

    #1276002

    Hi Daniele,

    Please try the code posted above by Dude, then replace the slug names on this line:

    if (is_product_category(array( 'shirts', 'games' ))) 

    with your own slugs.

    Best regards,
    Rikard

    #1278530

    thanks Rikard

    #1278724

    Hi Daniele,

    Glad we could help :)

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1374575

    How would this be applied to product tags in woocommerce?

    #1374598

    Hi hmsvictory,

    You should be able to use the is_product_tag conditional instead:

    is_product_tag( array( 'shirts', 'games' ) )

    https://woocommerce.com/document/conditional-tags/

    Best regards,
    Rikard

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