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?
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:
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.
Click Use Snippet. This auto-inserts the code.
Next, edit the snippet and switch it to Active then click Update:
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:
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:
Similarly, AIOSEO has this option:
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!