• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
  • VPS
    • VPS Hosting
    • Flex VPS
  • Reseller
  • Email
  • Gaming
  • Domains
  • Website Builder
  • Account
  • Blog Home
  • Categories
  • Authors

How to Change All Dates At Once in WordPress

Bhagwad Park

Published on: June 21, 2021

Categories: WordPress 0

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:

Creating the Dates Shortcodes
Creating the Dates Shortcodes

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:

Using the Dates Shortcodes in Posts
Using the Dates Shortcodes in Posts

Now when you preview your post, you should see that the shortcuts have been replaced by the appropriate values:

Shortcodes Have Been Replaced by Dates
Shortcodes Have Been Replaced by Dates

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!

Bhagwad Park Profile Picture
Bhagwad Park

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!

Related Posts

Joomla vs. WordPress: Which One Is Better?

In this post, we’ll consider five differences between Joomla and WordPress and how you might go forward with setting up a WordPress website.

A Complete Guide To WordPress Multisite Domain Mapping

Trying to figure out how to map your WordPress multisite setup? Check out our guide to understand how best to map all of your WordPress sites.

Drupal vs WordPress: 4 Key Differences

Drupal and WordPress are often grouped together as open source Content Management Systems (CMS). But in practice, WordPress and Drupal couldn’t be more different. Picking the wrong CMS for your project can make development a lot more troublesome. With the right approach, WordPress can be the backbone of almost any type of website. Drupal, on […]

What Is Self-Hosted WordPress?

In this post, we’ll differentiate self-hosted WordPress from WordPress.com, and discuss the benefits of the former.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup (2024)

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Email Hosting
  • Game Hosting
  • Domains
  • Website Builder
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2025 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA