WordPress Revision History Plugin

by damonp on March 12, 2007

in Sites,Software

Editing a post is a necessity from time to time, especially with any type of coding related blog. I particularly like to keep older posts up to date with revised download links as new versions are released. This prevents a user following a link off of a search engine to an old post and downloading an old version of one of my pieces of code. Surprisingly, I could not find a WordPress plugin to do just this. This tiny plugin allows you to attach timestamped revision tags to a post using the WordPress metadata system.

For an example in action see the Post History heading after this post.

Installation

  1. Download and unzip wp_revision_history.zip
  2. Upload revision_history.php to your WordPress wp-content/plugins/ directory.
  3. Add the following CSS to your stylesheet. Change CSS to match your site layout.
    #revision-date  {
        padding: 3px 5px 3px 12px;
        font-weight: bold;
        color: #333;
    }

    #revision   {
        padding: 2px 5px 8px 18px;
        color: #555;

    }
  4. Add the following snippet to your template where you want a post’s revision
    history to display

    <?php if(function_exists('wp_has_history') && wp_has_history()) {   ?>
    <h3>Post History</h3>
    <div class="cmeta" style="bottom-margin: 20px;" id="history">
    <?php wp_history(); ?>  
    </div>
    <?  } ?>

Usage

To add a revision tag to a post, add a new custom field named ‘history’ to the post. Set the custom field’s value to the revision note text. Multiple revision tags may be made to the same post by adding more custom fields with the key ‘history’. Each note will be automatically timestamped. The history listing will be sorted by the timestamp value.

Download WordPress Revision History

Popularity: 3%

Most Popular Posts

Damon Parker is a freelance sysadmin and web developer in Texas. He specializes in server setup, server security and high performance server configurations. Need help setting up a web server or getting a server back online after a crash or hack? Email Damon

{ 5 comments… read them below or add one }

Endolith May 19, 2007 at 4:56 pm

Does it actually save each revision, or just update the page with a list of when you changed it? I want an extension or plugin that saves each revision of a posting that I create. I’ve been using Google Documents to do it, but that’s less than optimal…

Reply

damonp May 21, 2007 at 8:23 am

No this does not track the actual text of different versions of a post. It only allows you to timestamp and comment any changes to a post.

Reply

tristan February 12, 2008 at 4:16 am

I think you should save the diff file (the difference between the current and the previous file in the database) so we can revert it to an older version, just like wikis. What do you think?

I was supposed to look at that plugin when google directs me here. Typing in keyword “wordpress revision plugin”.

Do you know anything like this? Thanks in advance.

Reply

Endolith February 12, 2008 at 10:15 am

See http://urbangiraffe.com/plugins/audit-trail/ for a plugin that keeps each revision.

Reply

tristan February 12, 2008 at 5:21 pm

thanks :)

Reply

Leave a Comment

{ 2 trackbacks }

Previous post:

Next post: