Yoast SEO: Titles & Metas template variables

Last update: 21 April, 2017

One of the most important functions of both Yoast SEO and Yoast SEO Premium is the possibility to add title templates and meta description templates to the homepage, all (custom) post types, all (custom) taxonomies and other pages.

Template variables can also be used on individual posts, pages and taxonomies.

In this article

Get access to our kick-ass support team with Yoast SEO Premium

Setting up / changing your templates

You can change your title & meta templates by going to the admin of your WordPress installation and clicking SEO → Titles & Metas.

1
Log in to your WordPress website. When you’re logged in, you will be in your ‘Dashboard’. On the left-hand side, you will see a menu. In that menu, click on ‘SEO’.
2
The ‘SEO’ settings will expand providing you additional options. Click on ‘Titles & Metas’.

If you do not see this option, please enable advanced features.

Yoast SEO > Titles & Metas
3
Under each tab, you can use these variables to create templates for various pages within your site.

You can use the variables from the partial list below to create your own templates for the titles and meta-descriptions. The full list of variables is listed on the HELP tab of the plugin. Just go to SEO → Titles & Metas and click the help tab in the top right.

NOTE: Below you will find only a sampling of the available variables. Please check the HELP tab in the top right corner of your WordPress admin screen in your Titles & Metas section for the complete list available to your site. You’ll find it here:

You can use the following sample of basic variables.

Basic Variables

%%date%% Replaced with the date of the post/page
%%title%% Replaced with the title of the post/page
%%parent_title%% Replaced with the title of the parent page of the current page
%%sitename%% The site’s name
%%sitedesc%% The site’s tagline / description
%%excerpt%% Replaced with the post/page excerpt (or auto-generated if it does not exist)
%%excerpt_only%% Replaced with the post/page excerpt (without auto-generation)
%%tag%% Replaced with the current tag/tags
%%category%% Replaced with the post categories (comma separated)
%%primary_category%% Replaced with the primary category of the post/page
%%category_description%% Replaced with the category description
%%tag_description%% Replaced with the tag description
%%term_description%% Replaced with the term description
%%term_title%% Replaced with the term name
%%searchphrase%% Replaced with the current search phrase
%%sep%% The separator defined in your theme’s wp_title() tag.

The following sample of variables require a better understanding of SEO. If you’re unsure about how to correctly use this, don’t. Or you can book a training at Yoast.

Advanced Variables

%%pt_single%% Replaced with the post type single label
%%pt_plural%% Replaced with the post type plural label
%%modified%% Replaced with the post/page modified time
%%id%% Replaced with the post/page ID
%%name%% Replaced with the post/page author’s ‘nicename’
%%userid%% Replaced with the post/page author’s userid
%%currenttime%% Replaced with the current time
%%currentdate%% Replaced with the current date
%%currentday%% Replaced with the current day
%%currentmonth%% Replaced with the current month
%%currentyear%% Replaced with the current year
%%page%% Replaced with the current page number (i.e. page 2 of 4)
%%pagetotal%% Replaced with the current page total
%%pagenumber%% Replaced with the current page number
%%caption%% Attachment caption
%%focuskw%% Replaced with the posts focus keyword
%%term404%% Replaced with the slug which caused the 404
%%cf_<custom-field-name>%% Replaced with a posts custom field value. Be sure to remove the <> as they are not needed.
%%ct_<custom-tax-name>%% Replaced with a posts custom taxonomies, comma separated. Be sure to remove the <> as they are not needed.
%%ct_desc_<custom-tax-name>%% Replaced with a custom taxonomies description. Be sure to remove the <> as they are not needed.

Was this article helpful? ·