The SEO Framework was initially named AutoDescription because its sole purpose was generating descriptions.
Since its inception, we wanted to uphold that name. Moreover, we don’t want you to spend hours on SEO, that’s wherefore our plugin is. So, we’ve developed and integrated symbolic-and logical interpretation AI that works with every language you throw at it. It is intelligent: we can’t anticipate what you are going to write, but we know that any description that comes out is excellent. It is better than what Google can generate, so keep that option enabled in TSF!
Of course, we assume you write accordingly: “Introduction – Context – Conclusion.”
As of TSF v4.1.0, the generator works like described below. For the sake of simplicity, we’re describing how it generates descriptions for posts and pages only.
The generator works in three sequences:
- The getter obtains the content information;
- The parser converts what the getter obtained to a description;
- The renderer formulates the parsed content into a safe and usable string.
Step one, the getter
- first takes your content (or excerpt, when available);
- strips sole link paragraphs (often used for Twitter and Youtube embeds);
- strips all shortcodes, which is why some page builders don’t work with this;
- strips all headers, images, scripts, lists, forms, etc. (i.e. plausible non-canonical and non-sentence content);
- replaces all leftover HTML tags with spaces;
- converts the content into a single line;
- converts non-break spaces and tabs to spaces;
- converts reverse solidus (
- converts sequential spaces to single spaces;
Now, we have clean and workable content for our parser. We removed some steps from the explanation since it’s more than convoluted.
Step two, the parser
- converts all HTML entities to human-readable entities (
& → &);
- takes a number of characters from the start of the content, excluding the last word or punctuation on that boundary:
- for Open Graph descriptions, it’s 200 characters;
- for Twitter descriptions, it’s 200 characters;
- for meta descriptions, it depends on the WordPress language set:
- 148 characters for Assamese (অসমীয়া);
- 158 characters for German (Österreichisch Deutsch, Schweiz Deutsch, & Deutsch);
- 148 characters for Gujarati (ગુજરાતી);
- 100 characters for Malayalam (മലയാളം);
- 70 characters for Japanese (日本語);
- 82 characters for Korean (한국어);
- 120 characters for Tamil (தமிழ்);
- 70 characters for Chinese (繁體中文, 香港中文版, & 简体中文);
- 160 characters for all other languages.
- texturizes the content as WordPress would, creating sentence structure and balance;
- breaks up the content into 3 distinctive parts (it’s actually 6, but let’s keep it “simple”):
- sentence after leading punctuation, but including opening punctuation, marks, and ¡¿, until first punctuation or end of content;
- the last punctuation character, but ignores connecting punctuation with a word-boundary (e.g. the
- The last parts consist of the leading words after the last punctuation character:
- If there are more than three leading words, it uses the complete sentence.
- If there are fewer than three leading words, it trims those words.
- If there are no words after the last punctuation character, it does nothing.
- trims leading spaces and non-closing punctuation;
- when no closing-punctiation is found at the end of the sentence, it adds
…in the renderer);
- convert the content back to machine-readable;
Now we are left with your description, or we have nothing at all. Because we may add symbols to make sentences or inviting content, it can consist of more characters than we would typically recommend.
Step three, the renderer
- texturizes the description (converting
…, transforming quote tags, etc.);
- converts HTML tags to readable HTML, so no intended tags are lost. E.g.,
- removes all leftover HTML (for secure display, just in case);
- converts “Wordpress” to “WordPress”, so to keep Mr. Mullenweg happy;
- finally trims all spaces.
Now we have secure content that can be used anywhere on your site. For a final secure touch-up, we escape the description for the meta tag’s attribute output.
For now, PHP is a single-threaded scripting language, and this means it can only do one thing at a time. We don’t want your site visitors to wait for a hidden tag to load, so we are strict and careful about what we integrate. It is why our software is performant, and why it takes months to release updates.
With that, the description generator is almost perfect, but not quite. For example, our generator isn’t aware of your intent, nor does it calculate the pixels used. So, if you want to make it perfect, consider if you have the time to do so, and fill in the meta tag yourself. The people we work with don’t have that time, and so we made this plugin.