Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

Automatically adding current date to meta title

mat

Joined
Apr 18, 2007
Posts
3,859
Reaction score
185
Looking to automatically add the current date (ie March 2017) to meta title.

I am using Wordpress with Yoast SEO and this is to be applied to only a certain group of pages under a Taxonomy.

Any help greatly appreciated.

Thanks!
 
Do the pages have their own page template ? If so you could base it off of the post date and just add it to your heading title tag, for example :

https://codex.wordpress.org/Function_Reference/the_date

https://codex.wordpress.org/Formatting_Date_and_Time

PHP:
<h1 class="entry-title"> <?php the_title(); ?>&nbsp;<?php the_date('F Y'); ?></h1>

Havent tested it but that should give ( F ) - full month wording - ( Y ) full year display.

Based on the posts date, so if you posted it now it would display : YOUR POST TITLE MARCH 2017
 
So on the above theory, if you wanted it to be the post date all the time then you would use %%date%% unfortunately with Yoast it shows the day as well as month and year.

Or if you were developing a title to try and make search engines believe your content is current by adding the date relevance, i.e How to do this kind of thing 2017 , then you could use %%currentyear%% and %%currentmonth%% which would dynamically change based on the actual current month and year and not the post date.
 
  • Winner
Reactions: mat
Hi Adam,

Thank you so much for taking time to help!

" - %%currentmonth%% %%currentyear%%"

added after the meta page title worked perfectly as you put above!
 
If you're doing it for SEO purposes, I'm not sure it will work... But if that is your reason for doing it, you may also want to investigate the "touch" command in Linux (assuming you're hosted on Linux) as that can be used to update the file creation timestamp
http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/

So if you've got a page that's "pretending" to have been written on 11 March 2017 (for example) then it helps the pretense if you can also timestamp the file behind the page as having last been updated on 11 March 2017.

This may be too complicated and/or overkill - and it's certainly not necessary if you're doing this for some non-SEO reason...
 
  • Like
Reactions: mat
There is plenty of SEO scope to use year specific focusing, often because the keyword data isnt available until that year falls and therefore its often over looked as apart of keyword research as the volumes are not there. For example something like "best broadband deals" would be more competitive than "best broadband deals 2017" but huge amounts of people are and have been using date based searches to get a more up to date, more specific search result.

Unfortunately I fear the golden age of doing that is now gone since Rand made a video about that exact tactic a couple of months ago and told every man and his dog something that many of us have been doing for the last decade successfully.
 
..........................
 
Last edited:

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Featured Services

Auctions Ending - Flip.uk

Sedo - it.com Premiums

IT.com

Premium Members

AucDom
UKBackorder
Register for the auction

Latest Comments

Acorn Domains Merch
MariaBuy Marketplace

New Threads

Domain Forum Friends

Other domain-related communities we can recommend.

Our Mods' Businesses

Perfect
Service
Laskos
*the exceptional businesses of our esteemed moderators
Top Bottom