Если нужно заполнять мета-теги всех статей и рубрик на автомате, то могут пригодиться следующие переменные популярного плагина для вордпресс, yoast seo.
Часто используемые мной:
Для статей –
Для рубрик –
Но, чтобы дескрипшн рубрики заполнялся, должно быть заполнено хотя бы обычное описание, откуда уже возьмется отрывок.
Полную документацию можно почитать по ссылке https://yoast.com/help/list-available-snippet-variables-yoast-seo/.
Я лишь скопирую оттуда сюда таблички для быстрого доступа.
Basic variables
Label | Variable | Description |
---|---|---|
Date | %%date%% |
Replaced with the date of the post/page |
Title | %%title%% |
Replaced with the title of the post/page |
Parent title | %%parent_title%% |
Replaced with the title of the parent page of the current page |
Archive title | %%archive_title%% |
Replaced with the normal title for an archive generated by WordPress |
Site title | %%sitename%% |
The site’s name |
Tagline | %%sitedesc%% |
The site’s tagline |
Excerpt | %%excerpt%% |
Replaced with the post/page excerpt (or auto-generated if it does not exist) |
Excerpt only | %%excerpt_only%% |
Replaced with the post/page excerpt (without auto-generation) |
Tag | %%tag%% |
Replaced with the current tag/tags |
Category | %%category%% |
Replaced with the post categories (comma separated) |
Primary category | %%primary_category%% |
Replaced with the primary category of the post/page |
Category description | %%category_description%% |
Replaced with the category description |
Tag description | %%tag_description%% |
Replaced with the tag description |
Term description | %%term_description%% |
Replaced with the term description |
Term title | %%term_title%% |
Replaced with the term name |
Search phrase | %%searchphrase%% |
Replaced with the current search phrase |
Separator | %%sep%% |
The separator defined in your theme’s wp_title() tag. |
Advanced variables
The following sample of variables requires a better understanding of SEO. If you’re unsure how to use these advanced variables, then we advise you not to use them.
Label | Variable | Description |
---|---|---|
Post type (singular) | %%pt_single%% |
Replaced with the content type single label |
Post type (plural) | %%pt_plural%% |
Replaced with the content type plural label |
Modified | %%modified%% |
Replaced with the post/page modified time |
ID | %%id%% |
Replaced with the post/page ID |
Name | %%name%% |
Replaced with the post/page author’s ‘nicename’ |
User description | %%user_description%% |
Replaced with the post/page author’s ‘Biographical Info’ |
Page number | %%page%% |
Replaced with the current page number with context (i.e. page 2 of 4) |
Pagetotal | %%pagetotal%% |
Replaced with the current page total |
Pagenumber | %%pagenumber%% |
Replaced with the current page number |
Caption | %%caption%% |
Attachment caption |
Focus keyword | %%focuskw%% |
Replaced with the posts focus keyphrase |
Term404 | %%term404%% |
Replaced with the slug which caused the 404 |
<custom-field-name> (custom field) | %%cf_<custom-field-name>%% |
Replaced with a posts custom field value. Remove the <> |
<custom-tax-name> (custom taxonomy) | %%ct_<custom-tax-name>%% |
Replaced with a posts custom taxonomies, comma separated. Remove the <> |
<custom-tax-name> description (custom taxonomy) | %%ct_desc_<custom-tax-name>%% |
Replaced with a custom taxonomies description. Remove the <> |
Пользуйтесь, на здоровье!