Displaying Last Updated Date in WordPress
This tutorial requires you to add code to your WordPress files. If you haven’t done this before, then we recommend you to look at our guide on how to copy paste code in WordPress.
Method 1: Show Last Updated Date Before Post Content
You will need to add this code to your theme’s functions.php file or a site-specific plugin.
Tables can't be imported directly. Please insert an image of your table which can be found here.
1 2 3 4 5 6 7 8 9 10 11 12 13
This code checks to see if a post’s published date and last modified dates are different. If they are, then it displays last modified date before the post content.
You can add custom CSS to style the appearance of the last updated date. Here is a little CSS that you can use as starting point:
Tables can't be imported directly. Please insert an image of your table which can be found here.
1 2 3 4 5
This is how it looked on our demo website.
Method 2: Add Last Updated Date in Theme Templates
This method requires you to edit specific WordPress theme files. Many WordPress themes now use their own template tags which define how these themes show post meta data like date and time.
Some themes also use content templates or template parts to display posts.
Few simpler themes will use single.php, archive.php, and other template files to show content and meta information.
You will be looking for the code responsible for displaying the date and time. You can then either replace that code with the following code, or add it right after your theme’s date and time code.
Tables can't be imported directly. Please insert an image of your table which can be found here.
1 2 3 4 5 6 7 8
This is how it looked on our demo site: