The content scorer powers the “SEO” column in the posts list table, the metabox score indicator, and the analysis API.
Score Display Colors
| Score Range | Color | Hex |
|---|---|---|
| 80-100 (Good) | Green | #059669 |
| 50-79 (Medium) | Amber | #D97706 |
| 0-49 (Bad) | Red | #DC2626 |
Rule-Based Scoring Algorithm (24 Checks)
The score starts at 0. Each of the 24 checks is worth a fixed number of points, set in RANKFORGE_Scorer::WEIGHTS, and the weights add up to 100 (Basic SEO 30, Additional 25, Title Readability 15, Content Readability 30). A check that passes adds its points. A graded check can add a part of them. A check that fails adds nothing, takes nothing away, and pushes an issue with the keys severity, message, group, points (what passing the check is worth) and code (the key in the table below). RANKFORGE_Scorer::score() is a pure function: it makes no WordPress calls and reads no database.
| Key | Group | Points | Passes when |
|---|---|---|---|
kw_in_title | Basic SEO | 5 | The focus keyword is in the SEO title. When no SEO title is set, the post title is used. |
kw_in_description | Basic SEO | 4 | The meta description contains the focus keyword. |
kw_in_url | Basic SEO | 3 | The URL slug contains the focus keyword. Hyphens and underscores count as spaces. |
kw_in_intro | Basic SEO | 4 | The focus keyword is in the opening of the text: the first 300 characters, or the first tenth of the text when that is longer. |
kw_in_content | Basic SEO | 4 | The focus keyword is somewhere in the body text. |
content_length | Basic SEO | 10 | 600 words or more earns all 10 points. 300 to 599 words earns 7, 100 to 299 words earns 4, and fewer than 100 words earns 0. |
kw_in_subheadings | Additional | 4 | The focus keyword is in at least one heading from H2 to H6. |
kw_in_alt | Additional | 3 | The focus keyword is in the alt text of at least one image in the content. |
kw_density | Additional | 3 | The focus keyword is used 0.5% to 3% of the words of the text. For a keyword of several words, the count is taken from its least frequent word. It needs the keyword in the content, and there is no partial credit. |
internal_links | Additional | 4 | The content has at least one link to your own site. |
external_links | Additional | 3 | The content has at least one link to another site. |
url_length | Additional | 3 | The URL slug is 75 characters or shorter. A post with no slug yet passes. |
media | Additional | 5 | The post has an image or a video: in the content, as an image address in the content, or attached to the post. |
title_length | Title Readability | 6 | The SEO title is 20 to 60 characters long: all 6 points. Shorter than 20 or longer than 60 characters: 3 points. No SEO title: 0. |
kw_title_start | Title Readability | 3 | The focus keyword, or its first word, starts in the first half of the title. |
title_number | Title Readability | 3 | The title contains a digit. This is an optional idea, not a requirement. |
title_power_word | Title Readability | 3 | The title contains a word from the built-in list of power and emotional words, for example best, guide, how, free or ultimate. English posts only: a post in another language passes this check automatically. This is an optional idea, not a requirement. |
description_length | Content Readability | 6 | The meta description is 120 to 160 characters long: all 6 points. Shorter than 120 or longer than 160 characters: 3 points. No meta description: 0. |
short_paragraphs | Content Readability | 5 | No paragraph is longer than 150 words. |
sentence_length | Content Readability | 5 | The average sentence is 20 words or shorter: all 5 points. More than 20 and up to 25 words: 3 points. Longer than 25 words: 0. |
flesch | Content Readability | 5 | The Flesch reading ease of the text is 50 or higher: all 5 points. From 30 to 49: 3 points. Below 30: 0. English posts only: a post in another language passes this check once it has enough text. |
passive_voice | Content Readability | 3 | A form of “to be” followed by a word ending in “ed” is found in 10% of the sentences or fewer: all 3 points. More than 10% and up to 20%: 2 points. More than 20%: 0. English posts only: a post in another language passes this check once it has enough text. |
has_headings | Content Readability | 3 | The content has at least one heading from H2 to H6. |
table_of_contents | Content Readability | 3 | The content has a table of contents: a Rank Forge table of contents block, three or more links to anchors on the same page, or the words “table of contents” in the text. |
- Nine checks need a focus keyword (
kw_in_title,kw_in_description,kw_in_url,kw_in_intro,kw_in_content,kw_in_subheadings,kw_in_alt,kw_density,kw_title_start), 33 points together. With no focus keyword they earn nothing and one extra issue with the codefocus_keywordis listed; the highest score is 67. - A keyword is found when the exact phrase is in the text or, for a keyword of several words, when every one of its words is.
short_paragraphs,sentence_length,fleschandpassive_voiceearn nothing before the post has 50 words and one real sentence.title_power_word,fleschandpassive_voicepass for a post that is not in English.- The label shown for each code in the overview of the most common issues comes from
RANKFORGE_Scorer::issue_labels().
Custom Scoring Rules
You can modify the effective score or add custom checks by hooking into the analysis flow:
// Add a custom scoring rule that penalizes posts without a call-to-action
add_action( 'save_post', function ( $post_id, $post ) {
if ( wp_is_post_revision( $post_id ) || $post->post_status !== 'publish' ) {
return;
}
$content = $post->post_content;
$has_cta = preg_match( '/<a[^>]*class="[^"]*cta[^"]*"/i', $content )
|| stripos( $content, 'sign up' ) !== false
|| stripos( $content, 'get started' ) !== false;
// Store a flag for your custom reports
update_post_meta( $post_id, '_custom_has_cta', $has_cta ? '1' : '' );
}, 25, 2 );// Build a custom scoring overlay that extends Rank Forge scores
function my_custom_seo_score( $post_id ) {
$cached = RANKFORGE_Analyzer::instance()->get_cached( $post_id );
$base_score = $cached ? (int) $cached->score : 0;
$penalties = 0;
// Custom check: post must have at least one external link
$content = get_post_field( 'post_content', $post_id );
$site_url = home_url();
preg_match_all( '/<a[^>]+href="([^"]+)"/i', $content, $matches );
$has_external = false;
foreach ( $matches[1] as $url ) {
if ( strpos( $url, $site_url ) === false && strpos( $url, 'http' ) === 0 ) {
$has_external = true;
break;
}
}
if ( ! $has_external ) {
$penalties += 5;
}
return max( 0, $base_score - $penalties );
}—