WordPress.org

Forums

Yoast SEO
Disable WP SEO from altering permalinks (stopwords) (7 posts)

  1. Justin Tadlock
    WordPress God
    Posted 1 year ago #

    I just thought I'd share the code for this for anyone looking to do it. I was surprised to learn that the plugin altered post slugs with no option to disable this, which is (as far as I can tell) not documented anywhere. I may have missed this somewhere though.

    Here's the code to disable this functionality. You'll need to drop it in a custom plugin.

    add_action( 'plugins_loaded', 'my_fix_yoast_seo' );
    
    function my_fix_yoast_seo() {
    	global $wpseo_admin;
    
    	if ( is_admin() )
    		remove_filter( 'name_save_pre', array( $wpseo_admin, 'remove_stopwords_from_slug' ), 0 );
    }

    http://wordpress.org/plugins/wordpress-seo/

  2. Justin Tadlock
    WordPress God
    Posted 1 year ago #

    Actually, scratch that last code. I was looking at an older version on my dev install. The most recent version of WP SEO will allow for this code instead:

    add_filter( 'wpseo_stopwords', '__return_empty_array' );
  3. Please Add Screenshots
    Member
    Posted 1 year ago #

    the plugin altered post slugs

    What for?

  4. Justin Tadlock
    WordPress God
    Posted 1 year ago #

    The plugin alters post slugs to remove "unwanted words" or "stop words". However, in doing so, it sometimes removes words that you actually need.

    The best example is when writing a post with "New York" in the title. The plugin would remove "new" from the slug, which could actually decrease SEO as opposed to helping.

    Personally, I just don't like plugins to alter things like this without me knowing about it beforehand.

  5. Please Add Screenshots
    Member
    Posted 1 year ago #

    You mean to say it changes the slugs automatically without any input from the user (apart from activating the plugin)?

    That's not good at all! I could think of a dozen examples right now where I wouldn't want a stop word removed, and who says what makes a word useless or not?

    Also, wouldn't that potentially break some internal links if you activate it after you write the post?

    Hmmm and no option to disable this makes it smell like Word(p)ress err WordPress again!

    Thanks for the hack

  6. Justin Tadlock
    WordPress God
    Posted 1 year ago #

    You mean to say it changes the slugs automatically without any input from the user (apart from activating the plugin)?

    Yes, that's exactly what it does in the current version.

    I does seem that this might be a planned option in the future:
    https://github.com/Yoast/wordpress-seo/issues/197

    Also, wouldn't that potentially break some internal links if you activate it after you write the post?

    No, that wouldn't happen. It'd only be applied to new posts.

  7. Ate Up With Motor
    Member
    Posted 1 year ago #

    Thanks, Justin -- I was gnashing my teeth about this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.