Focus Keyword not found in the URL

#39602
  • Resolved Joshua Mayo
    Rank Math free

    Hi,

    Do you guys have a filter I can use to add to my functions.php that will remove the “Focus Keyword not found in the URL.” score?

    As you know, the way Rankmath currently views the permalink is that it wants the keyword to match the permalink identically. It’s a best SEO practice that permalinks be as short as possible and not contain any stopwords. This means even if your keyword is a long-tail keyword that does use stopwords, the permalink still should not use stop words.

    I hope that this issue will be fixed in the future. Yoast understands this SEO practice, therefore they have their plugin setup accordingly. Unfortunately, Rankmath does not at the moment. However, Rankmath is still a superior plugin by far, and so I want to continue using it.

    But I have to get rid of the “Focus Keyword not found in the URL.” score factor or it will drive me crazy!

    So is there a filter I can use to add to my functions.php that will remove the “Focus Keyword not found in the URL.” score?

    Thanks so much!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Please add the following code to disable this test and then add the score(5) to another test:

    /**
     * Rank Math snippet to disable 'titleHasNumber' & 'contentHasTOC' tests.
     *
     * @param array  $tests Array of tests with score
     * @param string $type  Object type. Can be post, user or term.
     */
    add_filter( 'rank_math/researches/tests', function( $tests, $type ) {
    	
    	unset($tests['basic']['keywordInPermalink']);
    
    	$tests['basic']['keywordInMetaDescription']['score'] = 7;
    
        return $tests;
    }, 10, 2 );

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Joshua Mayo
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Joshua Mayo
    Rank Math free

    I added that code to the bottom of my functions.php file, but for some reason am still getting the Focus Keyword not found in the URL warning.

    Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math today.

    This filter only seems to execute when using the Classic editor to edit posts. I have raised this with our dev team and we will be getting back to you in a short while.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Michael Davis
    Rank Math pro

    Hi Joshua,

    To add to my previous response.

    I have updated the code to the following which seems to work:

    /**
     * Rank Math snippet to disable 'Keyword in Permalink' test.
     *
     * @param array  $tests Array of tests with score
     * @param string $type  Object type. Can be post, user or term.
     */
    add_filter( 'rank_math/researches/tests', function( $tests, $type ) {
    	unset( $tests['keywordInPermalink'] );
    	return $tests;
    }, 10, 2 );

    I hope this helps. Thank you.

    Joshua Mayo
    Rank Math free

    That seems to have worked beautifully. Thank you so much for your help with this Michael!

    Michael Davis
    Rank Math pro

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Focus Keyword not found in the URL’ is closed to new replies.