Before we get started…
If you’re using Yoast SEO, you’re obviously smart and interested in search & digital marketing. You may be interested in my Central MA SEO company, Mxt Media. Check us out, won’t you?
Ok, enough plug. Back to the regularly-scheduled Yoast SEO sleuthing.
[stripe html_class=”light-grey”]Yoast’s Variables
It turns out that the WordPress SEO by Yoast variables weren’t removed. They were just moved. In my searching and head-scratching, I finally found the answer in a WordPress support forum and I thought I’d share the answer here.
Here are both lists of WordPress SEO titles and metas variables, as provided by Yoast in his plugin’s Help section. See below for screenshots.
Basic WordPress SEO Title Variables
%%date%% | Replaced with the date of the post/page |
---|---|
%%title%% | Replaced with the title of the post/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) |
%%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. |
Advanced WordPress SEO Meta 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 |
%%ct_<custom-tax-name>%% | Replaced with a posts custom taxonomies, comma separated. |
%%ct_desc_<custom-tax-name>%% | Replaced with a custom taxonomies description |
Where’d they go?
It turns out that Yoast didn’t remove his list of title & meta variables; he relocated it. It’s now tucked away under the Help tab at the very top of the Titles & Metas screen.
Pingback: Meta-Description Tag für Custom-Typ generieren, WordPress SEO Yoast » netzmacher
Thank you! Was needing this list and you made it very easy :)
Pingback: Kompletter Guide für das WordPress SEO Plugin von Yoast | AKM3
Some people are going crazy looking for this list. I found it by accident :)
I have been searching for this forever. Thank you for posting not only the variables but also where to find them. Ugh, I lost half a day trying to figure this out and test variables!
Happy to help, Jared! Thanks for your comment.
What if i want to show the next day/month/year? For example current month is “April”, this can be done easily with %%currentmonth%% but i need to show “May” which is current month + 1.
Hi Nina, thanks for your comment. Interesting question. I don’t know off the top of my head. I’ve never tried.
Could you explain your use case? Obviously WordPress can’t show a list of posts you haven’t written yet, so I’m confused on how future dates will help you. Could you clarify?
I want to implement ‘next month’ on SEO title.
For example this page http://couponbeing.com/stores/zoolz-coupon-codes/
has seo title: Zoolz Coupon Codes April 2014
with title template: %%term_title%% %%currentmonth%% %%currentyear%%
I would like to change the SEO title to: Zoolz Coupon Codes April 2014 – May 2014
So I need to know the variable for “May”
I see! To my knowledge, there’s no way for WPSEO and its title/meta variables to do this for you. %%currentmonth%% is just a placeholder tag which tells WPSEO to look up the month.
I think that what you’re looking for would need to use more than just title variables. I looked at your source code and it appears you’re not using a post archive page. I’m not familiar with your site’s functionality, so I could be wrong about this, but it’s unlikely that any date is associated with that coupons page. You’ll need to find a way in your theme or with a plugin to tell WordPress which month you’re looking at. Once WP knows the date, it can calculate and return ‘next month’ name.
Alternatively, you could somehow modify or extend WPSEO to accommodate a %%nextmonth%% title variable. I don’t recommend modifying the plugin, but it would be pretty easy to generate a ‘next month’ value in your functions.php file or another plugin. I can’t say how easy it would be to access that next month name using WPSEO’s title editor. I’m not sure about that part.
@Nina, in looking a little closer, you may be able to define custom fields or custom taxonomies and then access them using Yoast’s %%cf_<custom-field-name>%% or %%ct_<custom-tax-name>%% variables. Try that! It sounds like the easiest solution if it works.
Pingback: Best Resource for Configure, Setting up and Optimize of Wordpress SEO by Yoast - Fresh Web Dev
danke sir!
Are these all the available variables or is there a way I can use parent custom taxonomies or post types in the variables? Or also possessive names that end in plural?
Example: Find out “parent custom category’s” “Post title” in “site name”
I already tried in all of it’s combinations and have had no success… any ideas?
I would need to get Woocommerce product attributes through a variable.
Seem that it would be possible using the %%ct_%% … as Attributes are custom taxonomies .. but it doesn’t work.
I saw in another post (march 2013 – http://wpquestions.com/question/show/id/7532) that a “woo commerce attributes are custom taxonomies, but an attribute “manufacturer” actually has a taxonomy name of pa_manufacturer”.
Anyone has an dieia on how to get an attribute as a Yoast variable ?
Pingback: Einführung: WordPress SEO Plugin by Yoast
I need to display my posts titles as following : ” post title + website name ” but the plugin shows ” post title + website name + site description ” , Kindly help me , which variable to use for posts ?
Thanks in advance.
Thanks for sharing!
How to use seo variables in Meta description of a page or post?
When I used seo variables in title it worked. But when I tried to use in meta description and keywords, it is not working.
Am trying to use %%currentmonth%% %%currentyear%% in meta description.
Your feedback may help.
Hi Karunakar, according to Yoast’s KB article — http://kb.yoast.com/article/146-yoast-wordpress-seo-titles-metas-template-variables — the variables should work in meta descriptions. This only applies to the global settings. I don’t think it will work on individual pages.
Hi
I want to use in the tags meta description with the title of the 3 latest posts in that tag.
Can you help me?
Thanks
How to display the category description bay seo Yoast … i have to try “” but dont show…
What is the variable for product category for woocommerce?
Hi,
i would like to know, if that possible, that the placeholder “%%currentmonth%%” display the current month in numbers, for example: “08” for August. It would be important, because the title Tag have a huge difference in length (May with 3 and september with 10! character).
Thanks for help!
Very helpful and timely blog post as I’m just going through Yoast to automate some of the meta data fields like description. Thanks!
%%title%% %%page%% %%sep%% %%sitename%%
Result:
Title
Page (Text on page and Photo)
–
Websiteurl
Is it possible to just have Title / Featured image / and sitename?
Is there a way to add Woocommerce “Brands” to the title?
%%name%% not working in site template.
What to do for that?
Thank you,
Do you know how to create new meta variables?
Thank you for your question, Kevin. I don’t know how. I suspect it’s probably possible somehow, but I’ve never tried.
Thank you for your fast reply.
You’re welcome. Good luck! If you do find out, please come back here and let us know!
Hey, TJ – Great (and timely) post!
My one Q – is there a specific variable for the Yoast meta description of an individual page or blog post? I’m trying to use a WordPress plugin which currently relies on the native {excerpt} variable as the description in social media posts. Would much rather display the meta description I’ve crafted in Yoast, as we use our excerpts for something else and they’re quite long.
Is there any way I can reference an individual post or page’s meta description via a variable?
Great question, Kipp. Thanks for weighing in.
I think you’d need some custom dev to make that happen. Shouldn’t be too hard to create a call to Yoast’s API and connect it get_post_meta() for your custom excerpt. Let me know if you want to talk further about that.
Thanks for the thoughts, TJ. I’ll likely do the dev myself – was just wondering if anyone else had found a better option, or if anyone knew if Yoast had built one natively. Thanks!
Understood. Happy trails! Let me know how it goes when you’ve finished. Maybe write your own post and share the link here? Would love to see how you did it.
very detailed and well explained article about Yoast SEO, but I am still confuse about the following topics in Yoast SEO, “Clean up the ” || “Add noodp meta robots tag sitewide” || “Redirect attachment URL’s to parent post URL”. These setting confuse me that what should i do for it and why so kindly explain these point’s of Yoast SEO.
How to optimize Robots.txt file for WordPress ?? Is sitemap included is robots.txt file is important for SEO or Indexing or not ? Simple example of SEO Optimize Robots.txt file ?
Really keen to understand how i can pull short form of the month.
%%currentmonth%% so instead of November, I would like to pull Nov