How to Insert SEO Variables in Yoast SEO for Dynamic Metadata
Blog
Olivia Brown  

How to Insert SEO Variables in Yoast SEO for Dynamic Metadata

Yoast SEO variables are inserted by adding short tags such as %%title%%, %%sitename%%, and %%excerpt%% into the SEO title or meta description template. These tags pull page data into metadata automatically, so an editor does not have to rewrite titles and descriptions one by one.

TLDR: A site manager can add Yoast SEO variables inside Yoast SEO > Settings > Content types or inside the Yoast panel on a single post. For example, %%title%% %%sep%% %%sitename%% can turn a post called “Winter Running Shoes” into “Winter Running Shoes – Example Store.” On a store with 400 product pages, this can cut metadata setup from several hours to under 20 minutes. One small template can also reduce missing title tags by 80% or more after a content audit.

What SEO Variables Do in Yoast SEO

SEO variables are placeholders. Yoast SEO replaces them with real page data when Google, browsers, and social platforms read the page. A variable may pull the post title, site name, category, excerpt, date, page number, or custom field data.

This is useful because most websites have repeated patterns. Blog posts need titles. Product pages need names and categories. Archive pages need term names. It drives some editors crazy that writing these fields by hand takes 30 seconds per page, then breaks again when a title changes. Variables fix that problem.

For example, a title template may look like this:

%%title%% %%sep%% %%sitename%%

Yoast may then output:

Beginner Yoga Poses – FitLife Studio

The editor writes the pattern once. Yoast fills in the right details for each page.

Image not found in postmeta

Where to Insert Variables in Yoast SEO

There are two common places to insert variables. The first is the global template area. The second is the Yoast SEO box on an individual page or post.

1. Global Templates

Global templates control many pages at once. An administrator can set default metadata formats for posts, pages, products, categories, tags, and archives.

  1. Open the WordPress dashboard.
  2. Go to Yoast SEO.
  3. Select Settings.
  4. Open Content types, Categories and tags, or Advanced, based on the content type.
  5. Find the SEO title and Meta description fields.
  6. Insert variables by typing them or using the variable picker.
  7. Save the changes.

A common blog post title template is:

%%title%% %%sep%% %%sitename%%

A common post description template is:

%%excerpt%%

This tells Yoast to use the post title in the title tag and the excerpt in the meta description. Simple. Clean. Usually good enough for large blogs.

2. Individual Posts and Pages

Single-page edits help when one page needs special metadata. An editor can open a post, scroll to the Yoast SEO section, and edit the SEO title or meta description field.

Variables can be mixed with custom text. For example:

Buy %%title%% Online %%sep%% Free Shipping Available

For a product named “Leather Laptop Bag,” the output may become:

Buy Leather Laptop Bag Online – Free Shipping Available

The catch is that the preview sometimes takes a few seconds to refresh. That delay feels longer than it should when dozens of pages need checking. Still, it is faster than manual editing.

Useful Yoast SEO Variables

Yoast includes many variables, but most sites only need a handful. These are the ones that get used most often:

  • %%title%% — Inserts the post, page, product, or archive title.
  • %%sitename%% — Inserts the website name.
  • %%sep%% — Inserts the chosen title separator.
  • %%excerpt%% — Inserts the post excerpt.
  • %%category%% — Inserts the post category.
  • %%primary_category%% — Inserts the primary category, when set.
  • %%date%% — Inserts the publication date.
  • %%currentyear%% — Inserts the current year.
  • %%page%% — Inserts page number data for paginated content.
  • %%term_title%% — Inserts the title of a category, tag, or taxonomy term.

Best Templates for Common Page Types

A site should not use the same pattern everywhere. Search intent changes by page type. A blog post, product page, and category archive each need a different approach.

Blog Posts

SEO title:

%%title%% %%sep%% %%sitename%%

Meta description:

%%excerpt%%

This works well when writers create solid excerpts. If excerpts are weak, the meta descriptions will be weak too.

Product Pages

SEO title:

Buy %%title%% %%sep%% %%sitename%%

Meta description:

Shop %%title%% at %%sitename%%. View details, pricing, and availability.

This format suits ecommerce pages. It adds buying intent without forcing an editor to rewrite every product title.

Category Pages

SEO title:

%%term_title%% %%sep%% %%sitename%%

Meta description:

Browse %%term_title%% articles, guides, and resources from %%sitename%%.

Category pages often get ignored. That is a mistake. They can rank well when metadata is clear and the page has useful content.

How to Use the Variable Picker

Yoast includes an Insert variable button in many metadata fields. An editor can click it and choose from a list. This helps prevent typing errors.

Typing %%titel%% instead of %%title%% will not work. Yoast needs the exact syntax. The variable picker avoids that issue.

After choosing a variable, the editor should check the snippet preview. If the preview looks too long, the template needs trimming. Search results often cut off long titles after about 50 to 60 characters. Meta descriptions often get cut after about 150 to 160 characters, though Google may rewrite them.

Common Mistakes to Avoid

  • Using too many variables: A crowded title looks spammy and may get cut off.
  • Repeating the site name twice: Some themes or plugins already add it.
  • Depending on weak excerpts: Empty or vague excerpts create bad descriptions.
  • Forgetting archives: Category and tag pages need clean metadata too.
  • Ignoring previews: A template may look fine in settings but awkward in real output.

Testing the Output

After saving variables, the site owner should test several page types. One blog post is not enough. A good review includes a post, page, category, tag, product, and paginated archive if those exist.

The page source can also be checked. In most browsers, the reviewer can open the page, view source, and search for <title> or description. SEO browser extensions can speed this up.

If the site uses caching, changes may not appear right away. Clearing the cache usually fixes it. Honestly, it feels like every SEO check takes 10 seconds longer when cache is involved, but skipping that step causes false alarms.

FAQ

What are Yoast SEO variables?

They are short placeholders that pull page data into SEO titles and meta descriptions. For example, %%title%% inserts the page title.

Can variables be used in meta descriptions?

Yes. Variables can be used in SEO titles and meta descriptions. A common meta description variable is %%excerpt%%.

Does Google always show the Yoast meta description?

No. Google may rewrite the description based on the search query. A strong template still helps because it gives Google a clear option.

Can custom text be used with variables?

Yes. An editor can combine text and variables, such as Buy %%title%% Online.

What happens if a variable is typed wrong?

Yoast may not replace it. The incorrect text may appear as written. The variable picker helps avoid this problem.

Should every page use variables?

No. Global templates are great for scale, but key landing pages often need hand-written metadata for better click appeal.