• Resolved Nabil Nawaz

    (@lvlessi)


    hey there, in yoast seo section below the wp editor there are by default snippets, like page title, sitename separator etc. How can i add more snippets myself to add into title?
    for example why i want to do it, i want to add year at the end of my a few posts, i dont have snippet for it, i have to edit the year myself after every year, liek for now posts having 2019 need to be changed to 2020 at title end

    how can i create a snippet that inserts the year itself at the end of the posts’ titles?

    Thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support amboutwe

    (@amboutwe)

    Template variables can be used to customize the title at the site or post/page level. A list of the variables can be found here: https://kb.yoast.com/kb/yoast-wordpress-seo-titles-metas-template-variables/

    More specifically, there is a deprecated %%currentyear%% variable that outputs the current year. If deprecated variables are used in the snippet editor, they won’t appear in the snippet preview, but they will show up in your source code to maintain backward compatibility. We recommend not using them as they are not helpful in many cases.

    Thread Starter Nabil Nawaz

    (@lvlessi)

    thank you for your reply, i used %%currentyear%% variable, it showed me the year in the snippet preview but when i updated my post and visited the page i didnt see year there in post title,

    can you help me how can ishow it? i have attached the screenshot below.

    http://www.upl.co/uploads/20200102514331577924167.jpg

    Plugin Support amboutwe

    (@amboutwe)

    The snippet variables are not applied to the title that appears on the page. They are used in the source code for search engines and the browser title.

    https://pasteboard.co/IO1AujC.png

    If you want to add the year to the title that appears on the page, please contact the author or support team for your theme as they handle that title output.

    Thread Starter Nabil Nawaz

    (@lvlessi)

    okay got it, thank you,
    one more question but that is related to gutenberg and classic editor behaviour with yoast. I want to add FAQ schema but i like using classic editor and that way i cant add schema using yoast.
    the question is, if i enable the gutenberg temporary for editing the existing posts and add FAQ schema block on those posts and save them, then i disable the gutenberg again, this way FAQ schema would work fine as it does with gutenberg?

    Thank you

    Plugin Support amboutwe

    (@amboutwe)

    Yes, you can temporarily switch to the Gutenberg editor to use blocks, like the FAQ block, and then switch back to the classic editor. However, changes made in the classic editor may cause the blocks and/or schema to no longer work for that individual post/page. In short, we don’t recommend it but it can be done if you take extra care.

    Thread Starter Nabil Nawaz

    (@lvlessi)

    do you mean it will work fine at first, but after if i make any change later using classic editor to that same page then it can cause errors?if yes, then if i make changes 2nd time with gutenberg again would it be fine then?

    Thank you

    Plugin Support amboutwe

    (@amboutwe)

    Editing non-block content in classic editor shouldn’t cause issues. It’s only if you were to make changes to the block content in classic editor.

    If you make changes to the block content in the classic editor, it will likely break the block and result in a ‘This Block Contains Unexpected or Invalid Content’ warning if you were to switch back to Gutenberg after changing the block in classic.

    Thread Starter Nabil Nawaz

    (@lvlessi)

    okay thank you

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘More Snippets’ is closed to new replies.