Audit Trail Plugin


Download: Audit Trail
Other: | SVN
Support: Forum

Audit Trail is a plugin to keep track of what is going on inside your blog. It does this by recording certain actions (such as who logged in and when) and storing this information in the form of a log. Not only that but it records the full contents of posts (and pages) and allows you to restore a post to a previous version at any time.

To summarize:

  • Log of user actions inside your blog – useful for finding out who did what in a multi-user system
  • Extensible, allowing other plugins the ability to add and display items in the Audit Trail
  • Ability to track registered user page visits
  • Fully localized


The plugin is simple to install:

  1. Download Audit Trail
  2. Unzip
  3. Upload audit-trail directory to your /wp-content/plugins directory
  4. Go to the plugin management page and enable the plugin

You can find full details of installing a plugin on the plugin installation page.

NOTE: If you are upgrading from a pre 1.0 version please de-activate and then re-activate the plugin. This will upgrade your database tables (unfortunately any existing Audit Trail data will be lost).

Audit Trail is available in the following languages (included in the plugin):

If you are multi-lingual then I always appreciate any translations that you can provide.


Once the plugin is installed then your actions are already being recorded. You can view the Audit Trail log from the Manage/Audit Trail page.


Note that some entries in the log can be clicked and will expand to show more details.


From the options page you can configure exactly what actions are audited. Any plugins that support Audit Trail will also display themselves here.


Users with the ‘edit_plugins‘ or ‘audit_trail‘ capability can view and administer the Audit Trail plugin. The ‘audit_trail‘ capability can be added with the Role Manager plugin.

Support & Bugs

Support and feature requests should be made through the Audit Trail support forum. You can contact me directly but I spend a very limited amount of time on direct support and you stand a better chance of being answered through the forum.

If you find the plugin useful then please do consider making a donation – it is appreciated and helps towards the maintenance of the plugin.


202 Responses to Audit Trail Plugin

  1. Great plugin! I use it to track number of hits to my blog by username; unfortunately, there’s one small bug (already mentioned by another user) that makes this usage problematic. Instead of listing the username under “User” in the CSV file, Audit Trail lists the action. This makes it impossible to sort by user in Excel and thereby extrapolate the data. Will happily make a further donation to PayPal if this issue is remedied. Thanks much!

  2. Looks like a great plugin. However after activating I’m getting the error: “Fatal error: Call to undefined function number_format_i18n() in /plugins/audit-trail/models/pager.php on line 473”

    Any idea how to fix?

      • Just upgraded. Great for having the delete function back.

        BUT… it produces errors

        Warning: Invalid argument supplied for foreach() in …/plugins/audit-trail/audit-trail.php on line 121

        Warning: Cannot modify header information – headers already sent by (output started at /…/plugins/audit-trail/audit-trail.php:121) in …/plugins/sidebar-login/sidebar-login.php on line 314

        • i find it.
          WP3.0 default theme change trail.php on line 10 11

          <form method="post" action="url ($pager->url) ?>”>
          render_admin (‘pager’, array (‘pager’ => $pager)); ?>

          change 11 10
          render_admin (‘pager’, array (‘pager’ => $pager)); ?>
          <form method="post" action="url ($pager->url) ?>”>
          will fine

  3. It’s worth noting that you have to select the list of activities to record in the logs from the ‘options’ menu after installation, otherwise it will not be keeping a trail of anything.

    Thanks for your contribution with this plugin.

  4. Great plugin. I was wondering though is there a way to make it display the users name as well as the login name, or instead of. the only reason I ask is because I use the facebook connect and for that to work it automatically uses the facebook user ID as the login name. This gets confusing when I am looking at the records.

  5. There is a bug probably in Audit Trail Plugin for time zone offset. If you set the time zone in WP using UTC offset rather than country/city name then wrong time is shown in the log. I found this error using WP-301 & AT-1.1.7 Please verify it.

    btw, wonderful extension!
    thanks :)

  6. This plugin does exactly what I wanted and was simple to set up and
    use. I have the same problem as the previous writer regarding the
    time; it does not show up correctly (the date is good), both with
    UTC or with City setting. Minor annoyance with an otherwise really
    nice little plugin! Lin

  7. I’m would like to only log event from logged in users and ignore public actions. I tried to add 0 to the ignore list of users, but it still logs public view. Is there a way for it to only track logged in user data?



  8. What a FANTASTIC plugin!

    It is exceptionally stylish in its presentation and functionality so Many thanks for providing exactly what I was looking for.

    I am using it to log visits to my Tips page to prevent possible issues with members about viewing the premium information.

    @raz and @Lin both mentioned the time issue some months back and as you have updated the plugin since it is a shame the issue was overlooked.

    Until then…

    The Solution is as follows:

    line 180 of audit-trail\models\audit.php reads:

    $wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->prefix}audit_trail (user_id,ip,operation,item_id,happened_at,data,title) VALUES(%d,%s,%s,%s,NOW(),%s,%s)", $user, $ip, $operation, $item, $data, $title ) );

    You need to replace the MYSQL function NOW() which uses the server time to:

    current_time(‘mysql’) which is the WordPress function to fetch the date/time according to the Timezone on the General Settings page.

    The line will now read:

    $wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->prefix}audit_trail (user_id,ip,operation,item_id,happened_at,data,title) VALUES(%d,%s,%s,%s,%s,%s,%s)", $user, $ip, $operation, $item, current_time('mysql'), $data, $title ) );

    I hope this helps your readers!

    Keep up the excellent work.


  9. Thanks for this great plugin!

    I’d like to add and display additional items in the Audit Trail.

    Can you direct me to instructions on how to do this?

    Specifically, I would like to log the changes the users make to their Display Name.

  10. Hello John,
    What a wonderful plugin. :)
    I wonder though. Does it work in a multisite environment?
    And if so, should it be network activated or site-by-site? Does it create any additional tables on the dB? If so is there an extra table for each site it gets activated or just one global table? Does it leave any data or tables after de-installation or de-activation?
    Thank you in advance.

  11. Looking for a way of monitoring visitors logging in and using the site, this looks exactly what I want, and I shall certainly make a donation if I can iron out the couple of wrinkles I have, and then use it. I am testing it on WP 3.3.1

    1) I see that other have had problems in the past in not being able to delete records. I am having the same problem – I tick the checkboxes for records to be deleted, go to ‘Bulk Actions’ where the only option in the list is ‘delete’, but when I click ‘Apply’, nothing happens.
    2) I see references to print files in some of the other posts, but cannot see how to do so, or to activate a print option or function.

    Can you help on these, please?

    Many thanks

  12. Why does the audit trail show Urban Giraffe viewing my site from different IP Addresses? I turned off “Audit Trail Actions”, but there are still some on there.

  13. Can it track changes to things like Theme settings, widgets etc. i.e. aside from posts/pages, I’m looking for something to track those kinds of changes. If Audit Trail doesn’t do that, do you know anything that does?

  14. Hello. I love this plugin and have made a donation.
    When I try to download to CSV, the file is zero bytes. Totally empty.
    The plugin is tracking several activities, boxes checked, plenty of data.
    If, before clicking the Excel icon, I select every line, still, CSV is empty.
    What might I be doing wrong?
    Thank you in advance.

  15. Hi, This looks great. Question for you: Can it track changes to template files? Our client wants to use a 3rd party SEO consultant, but we wish to track what they do and when, so we can be sure who is accountable if something goes wrong.

  16. Hi John, thanks for publishing this plugin, it’s definitely needed.

    I’ve found several bugs in the current release, though, and pointed out how to fix them on the forums:

    If you don’t have time to integrate those fixes into the official release, I’d be happy to help out with that. Just e-mail me and we can work out the details.

  17. Does the audit trail work with Gravity Forms?

    I’d love the ability to be able to see a full log of all the changes made to forms including the ability to return to a revision that was taken.


  18. I was wondering how to configure Audit Trail so that it works with fail2ban?
    Is there configurations that need to be done within the fail2ban config as well?
    Any newbie help would really be appreciated

Leave a Reply

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