Last Updated Shortcode

Artiss README Parser: README file could not be found or is malformed - Last Updated Shortcode

24 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 Irene

  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.


  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.

    Thanks, Lee

  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 </time> 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. thanks for sharing this great plugin :D

  18. 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?

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>