Last Updated Shortcode

Plugin URI: Contributors: bitacre
Donate link:
Tags: shortcode, echo, display, last, time, date, update, updated, modified, changed
Requires at least: 2.8
Tested up to: 4.4
Stable tag: 1.0.1

Creates a shortcode to display the date/time when a post/page was last updated (with optional formatting).


Creates the [lastupdated] shortcode to display the date and/or time of the last update to a post or page. If used without any arguments, it will display the date in the format configured in the Settings > General tab. It supports several optional arguments: format, before, and after. These options allow you to change how the date/time is formatted and if anything should appear before or after the date/time is displayed.


  1. Download the latest zip file and extract the last-updated-shortcode directory.
  2. Upload this directory inside your /wp-content/plugins/ directory.
  3. Activate 'Literal Shortcode' on the 'Plugins' menu in WordPress.
  4. Insert the shortcode in a post or page to return the date/time it was last modified.

Frequently Asked Questions

What is the shortcode?

You can use either [lastupdated] or [lastupdate], they both work identically.

What formatting options can I use

You can use any of the special date variables listed at this WordPress codex page. If you want to insert plain text (like the word "at" for instance) escape each letter with a backslash, \l\i\k\e \t\h\i\s.

How do I insert this in theme files?

Just wrap the shortcode in <?php do_shortcode( ); ?>. So to get the default display, just insert <?php do_shortcode( [lastupdated] ); ?>

Why did you make this?

Everyone likes a good shortcode!

Can I change the shortcode?

Yes, just open last-updated-shortcode.php and add or change what text you want to trigger the shortcode in on of the arrays near the bottom. If this gets any kind of popularity, I'll make that easier by adding an options page.

Can you add this feature I just thought of?

Can I? Yes. Will I? Yes, if I think it would be a helpful addition. I'm trying to keep things clean and simple, but there's always room for improvement, so let me know if you think a feature is lacking!


Last Updated Shortcode Screenshot 1
The default text that will be displayed when using the shortcode with no arguments [lastupdated].



  • Purely cosmetic update for WordPress 4.4


  • First released version.
  • There may still be bugs, but I can't find any.

Upgrade Notice


Purely cosmetic update for WordPress 4.4.


First release, no upgrade notice (included to make the WordPress readme.txt validator happy).

Readme Generator


Donations are graciously accepted to support the continued development and maintenance of this and other plugins. We currently accept Paypal and kind words.

38 Thoughts on “Last Updated Shortcode

  1. Thanks for the plugin – just what I needed!

    I was trying to get this to work in the footer and I thought I’d share the code here in case others need it too:

    The one given (below) did not work:

    • bitacre on October 4, 2012 at 11:08 pm said:

      Sorry, WP is stripping your code which it has a nasty tendency to do unless you remove a lot of the default hooks. For future reference, in the comments section of an unmodified WP site, if you just exclude the <?php and ?> tags from your PHP code, you usually won’t encounter this problem.

      Or you can just change the < and > to their respective HTML entities (which is what I just did, using &lt; and &gt; (I’ve got those two memorized, lol). I’m not sure what you’re exact solution was, but I presume it was something using the do_shortcode() function, which is a godsend.

      Please correct me if I’m wrong, I’m always interested to see what solutions come from other viewpoints. Thanks for the message and thanks for contributing!

    • bitacre on October 4, 2012 at 11:11 pm said:

      This also reminded me I’ve been meaning to add this exact shortcodes to the comments filter, so thanks also for that. It should work properly next time if you’re ever back in this neck of the woods :).

  2. How to translate? What is the orginal text to translate it with *.po?

    • bitacre on December 2, 2012 at 11:45 pm said:

      I have not yet internationalized this plugin, so there is no .po file. Since there is only one text string, this would be easy to do, so I will include this feature in the next update of the plugin. You can expect to be notified of an available update in the next day or so.

      When I do this, would you be so kind as to send me your translation of the .po file so I can include it natively for other users in your language?

  3. Not sure if this has anything to do with the WordPress 3.5 update, but if anyone is having trouble getting the php wrap to work, use this instead:

    <?php echo do_shortcode(‘[lastupdated]’); ?>

    • bitacre on December 22, 2012 at 4:32 pm said:

      You don’t use echo, you just use <?php do_shortcode( '[lastupdated]' ); ?>.

      Shortcodes are designed to be returned by PHP, not echoed. Echoing a shortcode function will probably make the content jump to the very top of the page, since the code is being echoed at the time of processing rather than being returned at the appropriate location in the template. Is this what you’re experiencing?

  4. Hi there,

    I like this plugin and will use it on the site of a client.
    He wants to add the name of the author of the article od site.
    Is this possible and how do I implement this to my shortcode?

    Would be glad if you could help me.

    Thank you and greetz from germany from

  5. Hi I have got the plugin working in the footer of my website but it only seem to work if a post is updated not a page I am using the genesis framework any ideas I have it in my functions file with the following:

    /** Customize the credits */
    add_filter( ‘genesis_footer_creds_text’, ‘custom_footer_creds_text’ );
    function custom_footer_creds_text() {
    echo ‘

    echo ‘Copyright © Dentistry For All · ‘;
    echo date(‘Y’);
    echo ‘ · All rights Reserved · Site By:‘;
    echo do_shortcode( ‘[lastupdated]’ );
    echo ‘


  6. Chanda on March 27, 2013 at 2:14 pm said:

    How would I change the color (white text)? It blends into my footer background.

  7. How can I hide the last updated time from the website.
    I just want to show the last updated date.


    • I just installed the plugin and thought these format arguments might help others. It took me a little while to figure it out.

      To show “Last updated: January 14, 2016″, use [lastupdated format=”F j, Y”]
      To show “Last updated: Jan 14, 2016″, use [lastupdated format=”M d, Y”]
      To show “Last updated: 1/14/2016″, use [lastupdated format=”m/d/Y”]

      I hope this help!

  8. Bwhall on April 15, 2013 at 8:35 am said:

    Love Lastmodified shortcode! I’m using the Nextgen gallery shortcode to display images on a page. Each time I add a new image to the Nextgen gallery I would like my lastmodified footer date to reflect the change without amending the actual page the Nextgen shortcode resides on. I’m hoping this makes sense and is possible?

    Kind regards


  9. is there a way to make the text bold?


  10. A GREAT plugin for news sites. Thank you for this great little tool 🙂

  11. This is a great plugin. I use it on one of my site and doing a little modification in the time format of the plugin. I tested to update few of my post, and the date showing up the last updated date. A few days later, I checked Google, and the search result shows the last updated date too. Wow, amazing. Seems like my post was published yesterday. Many thanks for you.

  12. Hello,


    I’ve a quick question regarding your “Last Updated Plugin”.

    Basically, I want it to say whatever the date was 5 days ago, at any given time. So if we look at it on the 15th, it will say it was updated on the 10th. If we look at it on the 16th, it will say 11th…

    => Last updated: “[Month Day, Year] minus 5 days” <=

    May I know is it possible to do that?

    => Also, how can I remove the time as well? (Only display the date) <=

    Appreciate if you can let me know.


  13. I have got a suggestion: Could you please make it HTML5 ready? That would mean the output of the shortcode would result in this:
    <time datetime="2009-10-22T13:59:47-04:00" pubdate="pubdate">
    October 22, 2009 1:59pm EDT

    The “pubdate” should be optional (not in default shortcode). The non-HTML5 compliant browsers would still render it normally, ignoring the unknown time tag.

    Also, there is an “undefined variable” bug in the script.

    Both things are also published here:



  14. Daniel on August 4, 2013 at 10:25 am said:

    I’m hosting on GoDaddy and, despite my time settings in settings > General of “August 4, 2013” and “3:22 pm”, the [lastupdated] shortcode displays “Last updated: August 4, 2013 at 15:21 pm”.

    Specifying a time format in the shortcode via “[lastupdated format=”l, F j, Y \a\t G:i A”]” does not change the time to 12hr format like I’d expect either (and it also doesn’t show the word “at”, despite the escaping).

    Any idea why this is or know of anything specific to GoDaddy that might be causing this?

  15. Patty on August 7, 2013 at 6:28 pm said:

    The plugin works great, thank you! I would love to be able to display just the date (last updated), but not the time. Any chance that’s something easy?

  16. It would be nice if the date format could be changed to European standard, like 20-8-2013 or 2013-08-20.
    And like Patrik requests, hiding the updated time would be great too.


  17. Minor request that might be helpful for future folks who download this plugin from the ADD PLUGIN search bar. In the description of your plugin that the WordPress plugin description pulls from show the actual basic shortcode [lastupdated] so it can be seen easily in the plugin description when you list your plugins in the admin area. This so the user does not have to come to your website if they can’t recall the syntax. 🙂 Little thing but it would be a nice tough to an otherwise perfect and LOW overhead plugin.

    I did not see any link in settings or anywhere else in the admin area that would list the shortcode itself after the plugin is installed… ( unless I missed it in which case forgive me for posting this request ).

    By the way this plugin is perfect for placing at the bottom of pages like Terms and Conditions, FTC Disclaimers and Privacy Policies. Really looks professional to the end user to see when these documents have last been updated !!!

  18. Roman on April 15, 2014 at 7:28 am said:

    Works well with this code

        <?php echo '<p class="meta-info">'; the_time('Опубликовано d.m.Y в H:i'); echo do_shortcode( ', [lastupdated format="d.m.Y в H:i" before="<span>последние изменения" </span>"]' ); echo '</p>'; ?>
  19. thanks for sharing this great plugin 😀

  20. I’ve installed and activated both this plugin and the literal shortcode plugin. And yet, when I add the code below into the footer.php file, the entire footer disappears. (I tried it in various locations, inside/outside of several divs, to no avail.>

    < ? php do_shortcode( [lastupdated format=”l, F j, Y”] ); ? > (without added spaces, of course)

    The site is using Twenty Twelve theme, and I started with its basic footer, and added additional text, and also want the footer to include page update… What am I doing wrong?

  21. NanKing on October 29, 2014 at 1:22 pm said:

    Great Plugin. Thanks. My only problem is that the date of the “last updated” is of a month ago- on all the pages where i put the shortcode…and not current. Even though I made a change on a page and updated, it is not recording it as updated today.

    Please help?

  22. hello!
    Just hoping to get a reply soon? That the date is (September 4th 2014) remains unchanged even after several updates to page. I only installed this plugin on Oct 29th. So not sure where its generating that date from?!

  23. I am having an issue where I am getting the “missing:updated” error just with my tags, categories and authors of my posts, not the posts themselves. This plugin puts the updated date on the post itself, but seems to have no effect on the tag/category/author. Any thoughts?

  24. Hi there,

    it works well but it’s only for post. How can i adjust it for the last edit on a page & post ?


  25. Hello!

    I am looking for a way to display the day and month in two different languages (depending which version of the page is viewed – estonian or english). How can I translate the plugin? The lang folder in plugins folder seems to be empty…

    Best wishes,

  26. Ståle Freyer on January 25, 2017 at 9:38 am said:

    Is there a way to suppress “Last updated:”? I would like to preceed the update date with the Norwegian word for that.

  27. Ståle Freyer on January 25, 2017 at 9:41 am said:

    Disregard! I found the “before” keyword.

  28. Great plugin but is it possible to update the timestamp based on when a element or tab is changed?

    For example; when I update the 5 Day Forecast the timestamp is for that only and not the page it is on.

  29. Hi
    Excellent plugin,congrats.
    I set the plugin 3 days ago and I made everything that you wrote, ang run excellent to my site.

  30. This is great plugin and worth to try. Thank you for sharing, appreciate.

Leave a Reply

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