Menu

BlogCadre

Search
Menu

BlogCadre

Search

2k Views by Jason Striegel August 7, 2024, 12:00 am inWordpress

How to Display the Last Updated Date of Your Posts in WordPress

Showing when a post was last updated is crucial for websites that regularly modify old content. This guide will teach you how to easily add updated dates in WordPress.

Contents

  • Why Display Updated Dates?
  • How to Show Updated Dates with WPCode
  • Adding Update Dates in Theme Templates
  • Managing Updated Dates for Minor Changes
  • Styling Tips
  • Conclusion

Why Display Updated Dates?

For blogs, showing the publish date is usually enough. But sites that change old posts need to display last updated dates too.

Here are some benefits:

  • Helps readers – Visitors know the post has fresh information. Prevents missing updates.

  • Builds trust – Shows your content is actively maintained and improved.

  • Increases authority – Updated dates tell search engines your site has authoritative, up-to-date content.

For example, our WordPress tutorials here are regularly tweaked and refined over time. Only showing publish dates would cause readers to miss our changes.

Displaying update dates helps visitors see our content is kept current:

Example Post Showing Updated Date

Having an updated date signals freshness and authority to search engines like Google. Pages with recent modified dates have been shown to rank up to 12% higher in some studies. It‘s a clear indicator of fresh, active content.

Now let‘s see how to add updated dates in WordPress.

How to Show Updated Dates with WPCode

WPCode allows adding code snippets safely without editing sensitive WordPress files. This is the easiest method for beginners.

First, install and activate WPCode.

Then go to Code Snippets > Add Snippet in your dashboard. Search for "last updated date" and hover over the Display the Last Updated Date snippet.

Searching for last updated date snippet in WPCode

Click Use Snippet. This auto-inserts the code.

Next, edit the snippet and switch it to Active then click Update:

Activating the WPCode snippet

The code will check if the post‘s publish date and modified date differ. If there‘s an update, it shows the last modified date above your content.

You can also add custom CSS to style the output:

.last-updated {
  font-size: 0.9em;
  text-transform: uppercase;
  background-color: #ffe5cc;
  border: 1px solid #f1c1b0;
  padding: 4px 6px;
}

This adds nice styling:

Styled last updated date output

The WPCode method is quick and easy. But you can also display updated dates by editing templates as covered next.

Adding Update Dates in Theme Templates

This requires editing your theme‘s template files to add PHP code. Locate the file outputting publish dates like single.php or loop.php.

Add this snippet below it:

$updated_date = get_the_modified_time(‘F jS, Y‘); 

echo ‘<p>Last updated on ‘ . $updated_date . ‘</p>‘;

This displays the updated date below the published date.

You‘ll likely need to modify different template files depending on your theme structure. But once added, it will show on all posts across your site.

As an expert WordPress developer, I recommend taking backups before editing any templates. Test changes on a staging site first too. Template modifications require a bit more work but provide more control compared to plugins.

Managing Updated Dates for Minor Changes

When tweaking posts like fixing typos, you likely want to keep the old modified date unchanged.

Here are some plugins that help control updated dates:

Plugin Pros Cons
Limit Modified Date Lightweight, simple Not updated recently
AIOSEO Advanced SEO options Extra features not needed by all
Revision Control Maintains full change history No way to limit modified date

The Limit Modified Date plugin adds a checkbox to disable updating the date when editing:

Limit Modified Date plugin checkbox

Similarly, AIOSEO has this option:

AIOSEO checkbox to limit modified date

So you can update posts seamlessly without affecting the modified date shown to visitors.

Revision Control keeps a history of all changes made to posts and pages. This complements displaying updated dates for full transparency.

Styling Tips

Here is some example CSS to customize the style of your updated date elements:

.last-updated {

  /* Text styling */
  font-size: 0.9em; 
  font-style: italic;
  text-transform: uppercase;

  /* Colors */
  color: #333;
  background-color: #ffe5cc;

  /* Borders and padding */
  border: 1px solid #f1c1b0;
  border-radius: 4px;
  padding: 4px 6px;

  /* Positioning */
  position: relative;
  top: -10px;

}

Play around with different property values like colors, sizes, and positioning to match your theme design.

Conclusion

Displaying updated dates improves transparency, trust, and authority. It only takes a few minutes to add using WPCode or editing theme templates directly.

This helps ensure your readers never miss important updates to your content.

Let us know if you have any other questions in the comments!

More From: Wordpress

  • PNG vs JPEG vs WebP – Which Is the Best Image Format for WordPress? (Edition 2024)

  • What are Navigation Menus in WordPress? How to Add Navigation Menus (Expert Guide)

  • How to Write a Detailed Blog Post Outline for WordPress (10 Steps)

  • 7 Best Twitter Plugins for WordPress in 2024 (Compared in Detail)

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.

You May Also Like

  • How to Completely Customize Your WordPress RSS Feeds: The Ultimate Guide for 2024

  • How to Highlight a Menu Item in WordPress (2 Methods)

  • How to Display Ad Blocks in Specific Posts in WordPress

  • How to Verify Your WordPress Site on Pinterest (Step-by-Step Guide for 2024)

  • How to Show / Hide Categories in WordPress (Ultimate Guide)

  • 12 Tips to Optimize Your WordPress RSS Feed (Quick & Easy)

Next post

DMCA.com Protection Status © Stella Cadre, LLC

  • About Us
  • Privacy Policy
  • Contact
Back to Top
Close
  • Home
  • Blogging
  • Social
  • Saving
  • Hacks
  • Credit and Debt Management
  • Loans
  • Job Search
  • Net Worth
  • Software
  • PC Tutorials
  • Network
  • Streaming
  • Alternatives
close