Nuvola apps important
This script is for PERSONAL use only!
You are free to install this script for yourself, but it is not allowed to be used wiki-wide (e.g., in MediaWiki:Common.js or MediaWiki:Wikia.js), as it would violate FANDOM's Terms of Use.
(See the customization policy)

LastEdited adds details about the last edit to the current page. These details include the time (minutes/hours/days/months/years) ago the last edit was made, user who made the edit, edit summary given (if any), the current page size in bytes and a link to open a modal to review the changes. The modal includes a link to the actual diff page, a link to undo the edit and a link to rollback the edits if the user has the required rights.

The date and time are added by default and cannot be changed, while the other options can be configured.


A demo can be seen live at the header of this page, listing the last edited details of the page.


See also: Help:Including additional CSS and JS, Help:Advanced CSS and JS
  • For personal use, add the code snippet below to your global.js page (for use on all wikis) or your common.js page on your wiki (for use on a single wiki). Note that personal JS must be enabled for your account.
    type: 'script',
    articles: [
importArticles — Best Practices for installing JavaScript on FANDOM

The importArticles statement is designed to combine multiple HTTP requests into a single data transfer, allowing multiple scripts to load and execute faster. If you've been installing several different scripts, your JavaScript file has probably accumulated unnecessary import statements. Click "Expand" to learn how to efficiently batch import scripts to speed up performance and make your code look cleaner. One other approach is by using the MediaWiki:ImportJS.

If your JavaScript file has several lines of code that say importScript, importScriptPage, or importArticles, you may be able to combine them! By batch importing a collection of scripts with a single import, your JavaScript code will load faster and look cleaner. Consider the example below. On the left is an example of what your JavaScript file might currently look like. On the right is how you could improve that code.

Multiple imports — messy and slow One import — clean and efficient
  type: 'script',
  article: 'u:dev:FloatingToc/code.js'
importScriptPage('page1.js', 'wikiname');
importScriptPage('page2.js', 'wikiname');
  type: 'script',
  articles: [

Note: In this example, pay close attention to the placement of commas and other punctuation. For people who aren't familiar with programming (and even those who are!), a common mistake when writing code is to accidentally delete, forget, or misplace critical symbols like commas or quotation marks. This can cause a syntax error that breaks the code. Carefully follow the convention shown here when using importArticles.

But there's much more to importArticles than just this! For more examples and advanced usage, see the help page at Help:Including additional JavaScript and CSS.


Key Description Type Possible values Default
avatar Editor's user avatar boolean true
avatarsize Size of the avatar integer None specific 15
size Current page size (in bytes) boolean true
diff Appends the last diff link
diffModal If the diff link should be loaded in LastEdited's diff modal. Useful in cases the user prefers opening diff links in QuickDiff.
comment Edit summary given*
time Decides whether the time mentioned must be in the "time ago" format or a timestamp string timestamp
timezone Decides whether the timestamp shown is in local or UTC format* UTC local
lang Changes the language displayed* Any valid language code None specific
position.element Controls where the details will be added object Any valid element present on the page
position.method Controls whether the details need to be appended or prepended to the element defined in position.element string append
namespaces.exclude List of namespace ids to exclude array None specific []
pages List of pages to exclude

All configurations made to the script are to be stored in the lastEdited object. Here is an example, using Japanese language:

window.lastEdited = {
    avatar: true,
    avatarsize: 20,
    size: false,
    diff: true,
    comment: false,
    time: 'timestamp',
    timezone: 'UTC',
    lang: 'ja',
    position: {
        element: document.getElementById('WikiaPageHeader'),
        method: 'append'
    namespaces: {
        exclude: []
    pages: []


  • If edit summary is not given with the edit, the whole part will be omitted, regardless of the value of comment.
  • lang is meant for personal use only. Using it sitewidely is not encouraged.
  • timezone is applicable only if time is set to timestamp.
  • The script works on all namespaces except for Thread and Board Thread.
  • For any styling, the class of the outer div is lastEdited and that of the avatar icon is lastEdited-avatar.
  • Make sure to follow the customization policy while selecting position.element. If not provided, the default positions are below the title on pages, and below the edit button on userpages.
    • Please use the talkpage if you can't figure out how to get the details to show up at a particular place.
  • If QuickDiff is used, LastEdited will not show its diff modal to prevent two diff modals from being used.
  • The table below shows a full list of default namespaces that can be used with the script with their ids for exclusion:
ID Namespace Description
-2 Media Used for direct linking to images. For example, Media:Wiki.png links directly to the image page.
-1 Special Special pages. Used by MediaWiki code and extensions
0 Mainspace Articles
1 Talk Article discussion
2 User Personal user pages
3 User talk Pages for discussion with users
4 Project/Sitename Wiki-related content
5 Project talk/Sitename talk Discussion of Project pages
6 Image/File File descriptions
7 Image talk/File talk File discussion
8 MediaWiki System messages and configuration
9 MediaWiki talk Discussion of MediaWiki pages
10 Template Templates
11 Template talk Template discussion
12 Help Help pages, also see Shared Help
13 Help talk Discussion about Help pages
14 Category Categories
15 Category talk Category discussion
110 Forum Old forum pages
111 Forum talk Discussion about old forum pages
500 User blog Blog pages
501 User blog comment User blog comments
502 Blog Blog listing pages
503 Blog talk Blog listing page discussion. Generally unused
828 Module Lua module pages
829 Module talk Lua module discussion pages
1200 Message Wall Pages used for the Wall extension. Touch only if you know what are you doing.
1201 Thread Message Wall thread namespace
1202 Message Wall Greeting Pages used for content above message boxes on Message Walls
2000 Board Board namespace. Used for storing board descriptions
2001 Board Thread Forum threads


Translations can be provided through the translations editor.

To do

  • Handle errors if rollback fails


November 1st, 2017
Script rewritten to use jQuery functions instead of DOM API
Added a diffModal configuration option
No longer throwing errors on ?action=edit
Extracted CSS to a separate stylesheet
mw.config caching
Extracted translation data to JSON to support the translations editor
Finding a user's avatar is no longer requiring another HTTP request
Script is showing a throbber before it finishes loading
Diff modal is loading faster
November 27th, 2016
Added a few requested features
October 14th, 2016
Script rewritten; added functionalities:
  • Minor edits are now marked
  • Change in size is indicated
  • Position of the details can be configured
  • More responsive modal
  • Edits can be rollbacked from the modal
July 9th, 2015
Added Monobook support.
April 4th, 2015
Date and time merged together to give an approximate time since the last edit using timeago.
April 3rd, 2015
Added i18n support.
Redid namespace support; added options to include/exclude namespaces and exclude pages.
April 2nd, 2015
Re-added previously removed editor's avatar.
December 30th, 2014
Added editor's avatar, per request.
December 1st, 2014
Namespace support.
November 15th, 2014
Features updated.
October 8th, 2014
Initial release.