Use these in titles and descriptions, in the editor, on term screens, in Search Appearance and in Pro’s schema templates. Variables with an argument take it in brackets. On Search Appearance, click the + next to a field to insert one.
| Variable | Result |
|---|---|
%title% | Title of the post, term, author, archive or search |
%sitename% | Site title (Settings → General) |
%tagline% | Site tagline |
%sep% | The title separator |
%excerpt% | The excerpt, or the start of the content, shortened to about 160 characters. %excerpt(30)% gives 30 words instead |
%category% | The post’s categories, comma-separated |
%primary_category% | The primary category, or the first one |
%tag% | The post’s tags, comma-separated |
%term(taxonomy)% | Terms of any taxonomy, for example %term(product_cat)% |
%term_title% | Name of the category, tag or term being viewed |
%term_description% | Its description |
%author% | Author’s display name |
%date% | Publish date. %date(F j, Y)% sets the format |
%modified% | Last-modified date, for example %modified(Y-m-d)% |
%page% | “Page 2 of 5” on paginated pages; empty on the first page |
%pagenumber% | Current page number |
%pagetotal% | Total number of pages |
%search_query% | The phrase searched for |
%post_type_name% | Singular name on single entries, plural on archives |
%id% | ID of the post, term or user |
%currentyear% | The current year |
%currentmonth% | The current month name |
%currentdate% | Today’s date |
%custom_field(name)% | The value of a custom field, for example %custom_field(price)%. Hidden fields (starting with _) are not allowed |
Test a template
With WP-CLI, wp wpiseo template "%title% %sep% %sitename%" --post=1 shows what a template produces. See WP-CLI commands.