Skip to main content

SEO Score

1. Filter to change parameters for the Front End SEO Score output.

/**
* Filter to change parameters for the Front End SEO Score output.
* Available parameters are: 'template', 'backlink', 'post_id', 'class'.
*
* @param array $args Parameters array.
* @return array
*/
add_filter( "rank_math/frontend/seo_score/args", function( $args ) {
return $args;
});

2. Filter to change HTML output for the Front End SEO Score function.

/**
* Filter to change HTML output for the Front End SEO Score function.
*
* @param string $html HTML output.
* @param array $args Function parameters.
* @param string $score calculated SEO score.
* @return string
*/
add_filter( "rank_math/frontend/seo_score/html", function( $html, $args, $score ) {
return $html;
}, 10, 3);
/**
* Filter to change the backlink inside the Front End SEO Score output.
*
* @param string $backlink Backlink HTML.
* @return string
*/
add_filter( "rank_math/frontend/seo_score/backlink", function( $backlink ) {
return $backlink;
});

4. Filter to hide SEO score

/**
* Filter to hide SEO Score
*/
add_filter( 'rank_math/show_score', '__return_false' );