{"id":485,"date":"2024-01-11T11:00:00","date_gmt":"2024-01-11T05:30:00","guid":{"rendered":"https:\/\/abhishekdeyroy.com\/articles\/test\/articles\/?p=485"},"modified":"2024-01-11T11:00:00","modified_gmt":"2024-01-11T05:30:00","slug":"show-old-post-updated-modified-date","status":"publish","type":"post","link":"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/","title":{"rendered":"How to Show Old Post Updated\/Modified Date in WordPress Without Plugins"},"content":{"rendered":"\n<p><strong>How to Show Old Post Updated\/Modified Date in WordPress:<\/strong> In <a href=\"https:\/\/wordpress.org\/download\/\" data-type=\"link\" data-id=\"https:\/\/wordpress.org\/download\/\" target=\"_blank\" rel=\"noopener\"><strong>WordPress<\/strong><\/a>, by default, the published date of a post is displayed on the front end of your website. However, the modified or updated date is not shown by default. This can be problematic if you frequently update your old posts and want to inform your readers about the latest changes. Fortunately, there is a way to display the updated date without using any plugins. In this article, we will guide you on how to show the modified date of old posts in WordPress without the need for additional plugins.<\/p><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#PHP_code_to_show_updatedmodified_dates_in_WordPress\" >PHP code to show updated\/modified dates in WordPress<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#Step_1_Access_the_Theme_Editor\" >Step 1: Access the Theme Editor<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#Step_2_Locate_the_Theme_Functions_File\" >Step 2: Locate the Theme Functions File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#Step_3_Add_Code_to_Display_Modified_Date\" >Step 3: Add Code to Display Modified Date<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#Step_4_Save_Changes\" >Step 4: Save Changes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#Step_5_Style_the_Modified_Date\" >Step 5: Style the Modified Date<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#Step_6_Preview_and_Test\" >Step 6: Preview and Test<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#FAQs\" >FAQs<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#How_do_I_find_the_last_updated_post_in_WordPress\" >How do I find the last updated post in WordPress?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#How_do_I_see_the_last_edits_in_WordPress\" >How do I see the last edits in WordPress?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#How_do_I_change_the_last_modified_date_in_WordPress\" >How do I change the last modified date in WordPress?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#Does_WordPress_have_a_revision_history\" >Does WordPress have a revision history?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PHP_code_to_show_updatedmodified_dates_in_WordPress\"><\/span><strong>PHP code to show updated\/modified dates in WordPress<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here you will learn how to show old posts with updated\/modified dates in WordPress without using any plugins and I will show you how can you do that with the help of some short code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Access_the_Theme_Editor\"><\/span>Step 1: Access the Theme Editor<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To begin, log in to your WordPress dashboard and navigate to Appearance &gt; Theme Editor. This will open the Theme Editor page, where you can make changes to your theme&#8217;s files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Locate_the_Theme_Functions_File\"><\/span>Step 2: Locate the Theme Functions File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>On the right-hand side of the Theme Editor, you will see a list of files. Look for the file named &#8220;functions.php&#8221; and click on it to open it in the editor.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/abhishekdeyroy.com\/articles\/articles\/wp-content\/uploads\/2024\/01\/Locate-the-Theme-Functions-File.png\" alt=\"Locate the Theme Functions File\" style=\"width:500px\"\/><figcaption class=\"wp-element-caption\">Locate the Theme Functions File<\/figcaption><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Add_Code_to_Display_Modified_Date\"><\/span>Step 3: Add Code to Display Modified Date<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Once you have the functions.php file open, scroll down to the end of the file and add the following code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ By Abhishek Dey Roy\n\nadd_filter( 'generate_post_date_output', function( $output, $time_string ) {\n\n    $time_string = '&lt;time class=\"entry-date published\" datetime=\"%1$s\" itemprop=\"datePublished\"&gt;Published on: %2$s&lt;\/time&gt;';\n\n\n\n    if ( get_the_date() !== get_the_modified_date() ) {\n\n        $time_string = '&lt;time class=\"entry-date updated-date\" datetime=\"%3$s\" itemprop=\"dateModified\"&gt;Last Updated on: %4$s&lt;\/time&gt;';\n\n    }\n\n\n\n    $time_string = sprintf( $time_string,\n\n        esc_attr( get_the_date( 'c' ) ),\n\n        esc_html( get_the_date() ),\n\n        esc_attr( get_the_modified_date( 'c' ) ),\n\n        esc_html( get_the_modified_date() )\n\n    );\n\n\n\n    return sprintf( '&lt;span class=\"posted-on\"&gt;%s&lt;\/span&gt; ',\n\n        $time_string\n\n    );\n\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<p>This code creates a function called `display_modified_date` that retrieves the modified date of the post using the `get_the_modified_date()` function.<\/p>\n\n\n\n<p>It then checks if the modified date is different from the published date using the `get_the_date()` function. <\/p>\n\n\n\n<p>If they are different, it appends the modified date to the content of the post with an appropriate HTML class for styling.<\/p>\n\n\n\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Save_Changes\"><\/span>Step 4: Save Changes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/abhishekdeyroy.com\/articles\/articles\/wp-content\/uploads\/2024\/01\/Save-Changes.png\" alt=\"Save Changes\" style=\"width:500px\"\/><figcaption class=\"wp-element-caption\">Save Changes<\/figcaption><\/figure>\n<\/div>\n\n\n<p>After adding the code, click on the &#8220;Update File&#8221; button to save the changes made to the functions.php file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Style_the_Modified_Date\"><\/span>Step 5: Style the Modified Date<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Now that we have added the code to display the modified date, we need to style it to match the design of your website. You can do this by adding custom CSS to your theme&#8217;s stylesheet. To access the stylesheet, go to Appearance &gt; Customize &gt; Additional CSS.<\/p>\n\n\n\n<p>In the Additional CSS section, add the following code to style the modified date:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n.modified-date {\ncolor: #888;\nfont-size: 14px;\nmargin-top: 10px;\n}\n<\/code><\/pre>\n\n\n\n<p>Feel free to modify the CSS code to match your website&#8217;s design preferences.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_6_Preview_and_Test\"><\/span>Step 6: Preview and Test<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Once you have saved the CSS changes, go to your website&#8217;s front end and navigate to an old post. You should now see the modified date displayed below the content of the post, indicating when it was last updated.<\/p>\n\n\n\n<p>It is important to note that this method will only display the modified date for posts that have been updated. If a post has not been modified, the modified date will not be shown.<\/p>\n\n\n\n<p>Also Read <\/p>\n\n\n\n<ul id=\"block-b6bbf913-8b44-4ba1-b377-74dc4b7c81b9\" class=\"wp-block-list\">\n<li><a href=\"https:\/\/abhishekdeyroy.com\/articles\/articles\/how-to-start-freelancing-in-india\/\">Best 5 Ways to Start Freelancing in India? Become a freelancer in India Now!<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/abhishekdeyroy.com\/articles\/articles\/edu-sites-for-backlinks\/\">(Latest) .Edu Sites For Backlinks Instant Approval: Why They Matter for Rankings<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/abhishekdeyroy.com\/articles\/articles\/how-to-get-google-adsense-approval\/\">How to Get Google AdSense Approval for Your WordPress Website In <\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/abhishekdeyroy.com\/articles\/articles\/discover-the-top-10-mind-blowing-ai-tools\/\">Discover the Top 10 Mind-Blowing AI Tools Revolutionizing Work<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1704989498380\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"How_do_I_find_the_last_updated_post_in_WordPress\"><\/span>How do I find the last updated post in WordPress?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Every theme adds its settings within the Customizer, so you may just find a toggle to only display the last updated date. And that&#8217;s exactly the case with Neve. To turn on the setting in WordPress,\u00a0<strong>go to Appearance &gt; Customize &gt; Layout &gt; Blog\/Archive.<\/strong>\u00a0<strong>Click on the Post Meta dropdown<\/strong>.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1704989520811\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"How_do_I_see_the_last_edits_in_WordPress\"><\/span>How do I see the last edits in WordPress?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p><strong>Click on Dashboard &gt; Simple History<\/strong>. From here you will see some search options. You can view all recent changes in WordPress here as they will be listed below the search options.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1704989536346\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"How_do_I_change_the_last_modified_date_in_WordPress\"><\/span>How do I change the last modified date in WordPress?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Changing the modified date can be done by\u00a0<strong>clicking the date link and selecting a new date for the post<\/strong>. It&#8217;s also possible to disable future updates of the last modified date by setting the \u201cFreeze modified date\u201d option to on.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1704989570297\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"Does_WordPress_have_a_revision_history\"><\/span>Does WordPress have a revision history?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p><strong>The WordPress editor autosaves your work and stores a revision history for each page and post on your site<\/strong>.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>By following the steps outlined in this article, you can easily display the modified date of old posts in WordPress without the need for any additional plugins. This allows you to keep your readers informed about the latest updates to your content, enhancing the user experience on your website.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Show Old Post Updated\/Modified Date in WordPress: In WordPress, by default, the published date of a post is &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Show Old Post Updated\/Modified Date in WordPress Without Plugins\" class=\"read-more button\" href=\"https:\/\/abhishekdeyroy.com\/articles\/show-old-post-updated-modified-date\/#more-485\" aria-label=\"Read more about How to Show Old Post Updated\/Modified Date in WordPress Without Plugins\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":488,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30,31,32],"class_list":["post-485","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howto","tag-modified-date","tag-plugins","tag-wordpress","resize-featured-image"],"featured_image_src":"https:\/\/abhishekdeyroy.com\/articles\/wp-content\/uploads\/2024\/01\/How-to-Show-Old-Post-UpdatedModified-Date-in-WordPress-Without-Plugins.png","author_info":{"display_name":"abhishekdeyroy","author_link":"https:\/\/abhishekdeyroy.com\/articles\/author\/abhishekdeyroy\/"},"_links":{"self":[{"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/posts\/485","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/comments?post=485"}],"version-history":[{"count":0,"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/posts\/485\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/media\/488"}],"wp:attachment":[{"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/media?parent=485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/categories?post=485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/abhishekdeyroy.com\/articles\/wp-json\/wp\/v2\/tags?post=485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}