• Resolved bichareh

    (@bichareh)


    Hi,

    thanks again for the great plugin.

    I have a feature request. Your plugin can “noindex” tags/categorys globally, but additionally I need to set some tags manually back to “index”.

    The reason: The most of my tags aren’t optimized with additional content, but some of them are and I want them in the Google Index.

    Thank you! ??
    Martin

    https://www.ads-software.com/plugins/autodescription/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi Martin,

    Thanks for the suggestion and the compliments! ??

    Filters are underway in the next update. More on that will come.

    If some of your tags are empty, noindex will automatically be applied to those.
    You can choose whether to disable all tags from being indexed, or just a hand-picked few.

    Remove them all from index
    I believe you’ve found this option already, but just to be complete: Go to the SEO Settings Page, and enable the “Apply NoIndex to Tag Archives?” within the Robots Meta Settings metabox.

    Remove only selected tags from index:
    While empty tags are always removed from index (no option, yet), you can selectively remove tags from being indexed underneath the “Tag SEO Settings”, by enabling the “Apply noindex to this Tag” option and saving the tag. You can apply this to all tags you wish to be removed from index.

    If you wish to get things more specific, please let me know the scenario and I’ll be sure to follow up :).

    I hope this helps! Thanks and have a great day!

    Thread Starter bichareh

    (@bichareh)

    Hi, thanks for your help!

    The problem is, I have over a thousand tags and only a few of them are optimized. Currently I have to set the most of them MANUALLY to noindex. That is horrible.

    The better version:

    Set all Tags at once to “noindex” and than manually set this few optimized tags to “index”. But that is currently not possible. You can only “noindex” the ~950 unoptimzed tags per hand.

    Hop you understand what I mean and sorry for my bad english. ??

    Thanks!

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Martin,

    I completely understand, your English is fine :).

    I can see how your feature request would work, unfortunately, due to the way The SEO Framework currently only handles positive values (i.e. turning noindex on) — switching them to a negative one (i.e. turning noindex off) requires a lot of deeply handled programming.

    This takes a lot of time and consideration (and most likely bugfixing!), so I’ll have to postpone this request to a later version.

    I hope you understand. And I’ll keep you updated on its progression.

    Thanks and have a wonderful day!

    Thread Starter bichareh

    (@bichareh)

    Hi,

    thanks for your message! ??

    Do you know any trick to tick the “noindex” checkbox on all tags at once? If I check the box to noindex all tags, there is nothing checked inside the tag pages itself.

    My solution would be: simply uncheck the noindex-box on all optimized tags.

    Thank you!
    Martin

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Martin,

    There is – in some sorts, and it’s quite tricky as to see when or where a tag isn’t or is indexed. But I tested it all out and it works as intended :).

    You can give this a go and it’s not permanent. So when you remove the code the default will be back to indexing (unless the Tag is saved, more on this below).

    add_filter( 'get_term', 'my_term_modifications', 9 );
    /**
     * Check the term.
     *
     * @param object|null $term The current Term.
     *
     * @return object|null $term
     */
    function my_term_modifications( $term ) {
    
    	if ( ( is_tag() ) || ( is_admin() && isset( $term->taxonomy ) && 'post_tag' === $term->taxonomy ) ) {
    		//* We're on a tag or within the tag edit screen - adjust defaults
    		add_filter( 'the_seo_framework_term_meta_defaults', 'my_seo_term_tag_defaults' );
    	}
    
    	return $term;
    }
    
    /**
     * Change Tag Term defaults.
     *
     * @param array $defaults The default Term options.
     */
    function my_seo_term_tag_defaults( $defaults ) {
    
    	//* Set noindex to 1.
    	$defaults['noindex'] = 1;
    
    	return $defaults;
    }

    What this code does is the following:
    1. It injects a check when the term is being fetched (post_tag, category, etc.).
    2.a. When this check is on the front-end, it will see if we’re on a tag.
    2.b. When this check is within the admin, it will see if “post_tag” is the taxonomy (a tag, that is).
    3. Then it will adjust the defaults through The SEO Framework filter.
    4. The filter will set the default value for noindex to 1.

    When does this work:
    a. When the Post Tag is new.
    b. Or when the Post Tag has never saved while The SEO Framework is active.

    So in other words, the Default will be in effect until the Tag data is saved and values have been set.

    The results reflect throughout the dashboard, and you’ll see the checkbox option active in the tag edit screen.

    You can deactivate the checkbox and the default will be overwritten by the settings.

    I hope this helps! It’s quite hacky but it’s the only way at the moment :).

    Thanks for your patience and I hope you enjoy your Sunday :).

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Noindex Tags’ is closed to new replies.