Title Tag current year

#211061
  • Resolved Philipp
    Rank Math free

    Hello,

    where exactly do i have to put this shortcode [%currentmonth% %currentyear%] when i want to place the current month and current year after every page meta title i publish?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Prabhat
    Rank Math agency

    Hello,

    Thanks for contacting us.

    To add the current month and year to the SEO title (title tag) of pages, please head over to your WordPress admin area > Rank Math > Titles & Meta > Pages, and add the %currentmonth% & %currentyear% in the Single Page Title field.

    Here’s a screencast for a quick reference:
    https://i.rankmath.com/ZzFF8m

    Hope that helps.

    Thank you.

    Thanks for that quick answer,

    i understand, but i always want to create a custom title tag and after that the currentyear and the currentmonth without adding it always manually.

    Is this possible too?

    Instead of “- Dart21.de” for example “[June 2021]”

    https://www.awesomescreenshot.com/image/9325100?key=95714e6d89e3716672f0407421df0149

    Hello,

    Thank you for the follow-up.

    You can add that in your custom title by editing the page like this:
    Current Year Month

    From your screenshot, it seems that you’re referring to the Google search results page. In case that the title is not getting picked up there, you can check the steps in this link for troubleshooting steps:
    https://rankmath.com/kb/different-meta-title-and-description/

    I hope that helps.

    Thank you, and please don’t hesitate to contact us anytime if you need further assistance with anything else.

    Hi,

    thanks. I know how to add it to every page manually, but what i want is that i create a custom title tag. After that the currentdate und month should be added automatically. So i dont have to add it manually to every page which takes me hours. Because I already created custom title tags.

    Prabhat
    Rank Math agency

    Hello,

    Thanks for your reply.

    Could you confirm if you’ve created the “Custom Title Tags” using a filter like this one?
    https://rankmath.com/kb/filters-hooks-api-developer/#change-the-title

    If not, then please explain what you mean by the custom title tags, so that we can assist you accordingly.

    Looking forward to hearing back from you.

    Thank you.

    hi,

    this is one custom title. I created one for every page.

    https://www.awesomescreenshot.com/image/9364746?key=639cfb9daa70f0b487acc7d5656a88b0

    Now i understand that i can add the currentyear and currentmonth on every page manually like this.

    https://www.awesomescreenshot.com/image/9364787?key=a6a063ecb4a42c2b8cfc3b0ff14c465a

    But with over 100 pages that will take me hours.

    So my question is, can i add the currentmonth and the currentyear on every page at once?

    Ankit
    Rank Math business

    Hello,

    Thank you for your reply.

    You can do that by heading over to your WordPress admin area > Rank Math > Titles & Meta > Pages, and add the %currentmonth% & %currentyear% in the Single Page Title field as previously mentioned by my colleague.

    You can use the following filter to get your job done.

    Paste the filter inside your theme’s function.php file.

    add_filter( 'rank_math/frontend/title', function( $title ) {
    $curYear = date('Y'); 
    $curMonth = date('M');
    
    	return $title .$curYear." ".$curMonth;
    });

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi,

    ah this what i need, thanks!

    And there is always – dart21.de after every title tag. How can i remove this?

    https://www.awesomescreenshot.com/image/9325100?key=95714e6d89e3716672f0407421df0149

    Thanks

    Brian
    Rank Math free

    Hello,

    Thank you for getting back to us.

    Usually that could be added if you have included the %sitename% variable into the titles and meta of your posts or pages.

    Thus if you do not wish to have the in your meta title since it’s used in search engines, then you would have to remove it in the global settings of your titles & meta.

    Head over to Rank Math > Titles & Metaselect the posts/pages and under Single Post/Page Title you should remove the Sitename variable.

    Once done, Google should be able to have this updated after a while once it re-crawls your site.

    Hope this helps. Please let us know if you have any other questions for us.
    Thank you.

    Thanks,

    i added the code in the function.php. But now it look like this:

    “Dartteppich Test – Die besten Dartmatten!2021 Jun”

    Can y send me the code, so i looks like this:

    “Dartteppich Test – Die besten Dartmatten! [Juni 2021]”

    So the month in german, with a space between and some clings

    Best wishes

    Prabhat
    Rank Math agency

    Hello,

    Thanks for your reply.

    You can slightly modify the code provided by my colleague to get the spaces with brackets and change the position of month and year.

    Please replace the previous code with the below one and see if it gets you the desired result:

    add_filter( 'rank_math/frontend/title', function( $title ) {
      $curYear = date('Y'); 
      $curMonth = date('M');
      return $title . " [" .$curMonth." ".$curYear. "]";
    });

    For the translation of the month name, could you confirm if you’re using the String translations of WPML or any other tool that translates the meta title to German?

    Looking forward to hearing back from you.

    Thank you.

    Hi,

    thanks for your help. I dont use any other plugins for translation. Would be nice if there is another way to translate the month into german.;)

    Brian
    Rank Math free

    Hello

    Unfortunately, we rely on plugins to perform the translations of these strings. The WPML is the most recommended plugin to handle this at the moment. Please let us know how you achieve your translations on your site.

    We are looking forward to helping you.
    Thank you.

    Prabhat
    Rank Math agency

    Hello,

    Thanks for your reply.

    That’s completely normal for Google to include your site name in the titles automatically – even if you deliberately leave them out from your titles.

    Here’s an article mentioning that as well.
    https://seo-gold.com/marcus-lemonis-website-seo-review/google-automatically-adds-brand-name-to-titles/

    And a link to Google’s forums with replies from Experts saying that it is like that on purpose:
    https://support.google.com/webmasters/thread/5328043?hl=en&msgid=5328043

    If you wish to know Google’s guidelines on writing Good titles, here are the guidelines straight from the horse’s mouth:
    https://support.google.com/webmasters/answer/35624?hl=en

    With that said, it largely depends on keyword intent too. For some keyword searches, your custom title might appear while for others – Google might append your brand name to the title and there is nothing you can do to force them to do otherwise. That is regardless of what SEO plugin you use.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Title Tag current year’ is closed to new replies.