As a website owner, you want your visitors to realize that your site contains the most up-to-date information. This means that you frequently have to include dates in your titles and content. But let’s be honest it’s not just for visitors, but also search engines. Some of us might wrinkle our nose in distaste at the idea of writing something just for SEO, but it’s a practical necessity. As a result, we’re forced to use dates and sometimes even months throughout our website, and changing them all at once regularly can be tedious. Here’s a quick way to do it in one go.
Including Dates in Content – a Necessary Evil
I’d written a post last year about how Google claims that something isn’t necessary when in reality it very much is! An example of this is dates in content. Like it or not, users often search for something with the date included. So for example, this might search for “best XYZ for 2021”, and in such situations, you have to include the data in your content. Otherwise, you’ll be outranked by your competitors who do the smart thing.
But apart from search, visitors also want to see the data in your title. It creates a feeling of freshness compared to pages that don’t, even though the “dateless” page may be fresher! So as business owners and “do-it-yourself” SEO experts, we have to play the game. Sometimes we need to go so far as to change the month – even if the rest of the content remains the same.
We end up sprinkling dates and months throughout our website, in promo materials and blog posts. And when the month or year changes, we need to make the change everywhere at the same time. It’s not a good idea to use a plugin like “Better Search Replace” because it’s too broad a hammer, and you might end up replacing something you shouldn’t!
A better solution is a plugin called “Custom Website Data”.
Using the “Custom Website Data” Plugin
While this plugin hasn’t been updated in a while, I can attest that it works perfectly with no modifications necessary. Download and install the plugin using the provided link. Keep in mind that because it’s an older plugin, it might not show up, so include the author of the website in your search term “Danny Weeks” and you’ll get it.
Then add a new record for your months, years, and dates like this:
In the above screenshot, I have a new record called “dates”, and sub-sections called “next_month”, “this_month”, and “this_year”. Each has a value denoted by the equal sign.
Then use the shortcodes instead of the dates in your posts like this:
[cwd ref=”dates” key=”this_year”] for the year, and so forth. Here’s an example of what it looks like in a post:Now when you preview your post, you should see that the shortcuts have been replaced by the appropriate values:
You can do this throughout your site in areas where you want dates and months to appear. And then when the month changes, or the year changes, you just need to update the record in the Custom Website Data plugin interface, clear your cache, and you’re done! All your pages will update automatically with the new dates. And unlike a blunt tool such as “Better Search Replace”, only those dates will change that you’ve specifically added as shortcodes!
This is just one way to make managing your website easier. Changing dates globally like this is a necessity for SEO – there’s no getting around it. Visitors want dates in content, search engines take note of them, so you have to adjust to realities. So we might as well use a tool that makes our lives easier!
I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!
Leave a Reply