• 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 );
    }

    https://www.ads-software.com/plugins/wordpress-seo/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Justin Tadlock

    (@greenshady)

    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' );

    the plugin altered post slugs

    What for?

    Thread Starter Justin Tadlock

    (@greenshady)

    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.

    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

    Thread Starter Justin Tadlock

    (@greenshady)

    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.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Disable WP SEO from altering permalinks (stopwords)’ is closed to new replies.