This is the talk page for discussing improvements to the AjaxUndo page.


How to add translations for this code?
MarkosBoss (dyskusjawkład) 16:27, November 21, 2011 (UTC)


What is the benefit of AjaxUndo over regular undo? Thanks! :) — SpikeToronto 04:50, October 10, 2012 (UTC)

NVM. I get it now. — SpikeToronto 05:12, October 10, 2012 (UTC)

Diff undo

If you try to undo a diff between "distant" revisions, the script will undo just the last revision and won't restore the revision you are making the diff with. leviathan_89 13:23, February 16, 2013 (UTC)

This issue is still present. leviathan_89 09:20, May 26, 2013 (UTC)

I believe that is intentional, by design. :) — SpikeToronto 04:55, July 24, 2014 (UTC)

custom messagebox

This script does not allow for entering an additional edit summary; the default summary of Undo revision XX by XXX is used. Is it possible for say a little box that appears near this button so that an additional edit summary can be entered before the button is pressed, with Undo revison XX by XXX as the default summary?

E.g. A user has just entered unconfirmed content on a page. By default, the existing edit summary in the "box" is something like (e.g.) Undo revision 96098 by (talk). By adding "Unconfirmed - " to the beginning of the box, the new edit summary is Unconfirmed - Undo revision 96098 by (talk).

Can this script be modified to do that? — SW8573 (Talk) 15:10, May 10, 2013 (UTC)


What does this script actually do? The description offers no explanation of the function and I'd rather not find out by randomly clicking links. ~Bobogoobo (talk) 11:09, August 19, 2013 (UTC)

It does exactly what the undo link does, except that it uses Ajax to do it. This means it performs the undo action with one click and without leaving the page. The reason to want this is that it saves time, as the normal undo link requires you to click it, load the undo edit page, and then click save. Cheers, grunny:~$ 13:43, August 19, 2013 (UTC)
Ah, I see, thanks. ~Bobogoobo (talk) 17:00, August 20, 2013 (UTC)

Recent Changes?

Is there any way to get this to appear in Recent Changes?

Spydar007 (Talk) 09:54, September 29, 2013 (UTC)

Yes, but to me there's not much point. Undoing is normally used to remove incorrect edits made in good faith. I might use it to fix a misclick I made somewhere or a blatant error made by someone I know that doesn't require explanation. Using AjaxUndo from RC implies that you haven't checked the edit in the first place (because if you had you'd be able to undo it from the diff) and are dealing with a persistent known vandal who requires blocking. In this case rollback is a more suitable tool, which use of implies removal of blatant misinformation/vandalism. And rollback appears in recent changes already. cqm 00:52, 1 Oct 2013 (UTC)
I suppose, but can you try and include it anyway please?
Spydar007 (Talk) 16:18, October 1, 2013 (UTC)

Rollbackers only?

Can this be made so that it only appears if one has rollback privileges, sysop, etc.? If it were, then it could be added site-wide, yet only be available for all those who’ve been entrusted with the rollback bit. Thanks! — SpikeToronto 04:54, July 24, 2014 (UTC)

This is a very late reply but you can do this:
if (wgUserGroups.includes('rollback')) {
    importScriptPage('MediaWiki:AjaxUndo/code.js', 'dev');

--Sophie 16:14, September 24, 2016 (UTC)


It works! I like it! But there is a problem what I would like to be fixed.It doesn't work with AjaxDiff or QuickDiff.Can you please fix it? Thanks!

15?cb=20151014002044~~Peridoork 18:49, September 5, 2016 (UTC)

According to the original coding, it never did. -- That Rainbow Hugging Bud ^-^ 04:03, September 6, 2016 (UTC)
Yes, it never did, so there is nothing that needs to be fixed. However, you can contact the author of this script and suggest to them to add this functionality. —Monochromatic Bunny | 07:27, September 6, 2016 (UTC)

Not working

Doesn't seem to be working right now, keep getting a "Unknown result from API" error whenever I use it. --Sajuuk 18:57, November 1, 2016 (UTC)


For some reason, whenever I'm on a wiki with AJAX Undo for the whole site, and I have it in my global.js, there appears to be two links. Cheetawolfnitrotyper (talk) 17:42, March 7, 2018 (UTC)

I added double-loading prevention now, so that shouldn't happen once the script is approved. -- Cube-shaped garbage can 19:15, March 7, 2018 (UTC)


I think this script would be more useful if it appears on users' contribs pages. It's needed when there's obvious vandal and you must open all diffs to revert harmful changes, that's annoying. Rail My talk 11:13, July 16, 2018 (UTC)

MessageWall support

This script seems to lack MessageWall support. I'm seeing a talk page link in the edit summary on wikis with MessageWall enabled... —RyaNayR (talkcontribs) 03:37, January 31, 2019 (UTC)

Is there any active maintainer or anything? Just looking for anyone that knows anything. —RyaNayR (talkcontribs) 04:06, January 31, 2019 (UTC)
That's the MediaWiki autosummary for undoing. If Fandom doesn't link to walls in the autosummary, the script won't either. Besides, User talk namespace redirects to the Message Wall namespace anyways. -- Cube-shaped garbage can 07:17, January 31, 2019 (UTC)
It didn't for me :\ I just got a blank talk page. I was expecting it to do like you said. I Guess that's a Staff thing I'll bring up to them. —RyaNayR (talkcontribs) 07:45, January 31, 2019 (UTC)
Oh wait no, no, I'm talking about the MessageWall namespace not redirecting to the talkpage namespace, not the other way around. —RyaNayR (talkcontribs) 07:49, January 31, 2019 (UTC)

AJAXUndo and revdeleted revisions


I find a bug of this script, this script must be corrected because "(AJAX Undo)" is still shown in the deleted revision.

I don't know if it is possible to revert to the revdeleted version ?

--TokihikoH11 (talk) 13:30, April 22, 2019 (UTC)

You could try making a test case and see what happens. Make a test rev and delete it then try to undo it. Does that give any error? —RyaNayR (talkcontribs) 18:58:57, 22 Apr 2019 (UTC)
Unfortunately, admins can not delete revisions with the aid of Special:RevisionDelete. HM100 19:11, April 22, 2019 (UTC)
I avoid trying to revert to the revdeleted version. --TokihikoH11 (talk) 19:16, April 22, 2019 (UTC)

added comment protection

Somehow AjaxUndo here removed the ability for no-admins to comment the article. --DarkBarbarian.pngBarbar (talk) 21:13, October 14, 2020 (UTC)

That's a Fandom bug. -- Cube-shaped garbage can 21:14, October 14, 2020 (UTC)

QuickDiff through Special:RecentChanges + Edit Summary

I wasn't sure if I should've gone to this talk page or the QuickDiff talk page for this, so please tell me if I should go to Talk:QuickDiff with this issue.

I noticed a much earlier comment on this talk page asking if AjaxUndo can be added to recent changes, but someone stated that that wasn't a good idea considering the only reason someone would likely want to undo stuff from recent changes is to vandalize, as undoing an edit from recent changes means one didn't view the changes. However, I use QuickDiff, so clicking the diff link on Special:RecentChanges means I can easily see the differences.

When I open the QuickDiff model on Special:RecentChanges, "Ajax Undo" does appear, but clicking it just results in the loading icon going on forever without any action being done.

Special:RecentChanges is the only place I've personally seen this happen at with QuickDiff. using AjaxUndo through diff links on the Recent Wiki Activity (from the SeeMoreActivityButton) seem to work fine.

Edit Summary

Someone else had also brought this up here, but it never seemed to get any attention. If there was a way to set a custom edit summary with each AjaxUndo execution, that'd make me and others feel better about using AjaxUndo — if one is making an edit in good faith, it's always best to explain why their edit was undone, espesially for new users who may be unfimillar with standards on a wiki.

I was thining that perhaps something like a (+) could be added next to the AjaxUndo button, and clicking this allows one to put their own edit summary in before undoing the edit. I'm not familliar with JavaScript — just CSS — so I'm sorry if what I'm asking for isn't really possible for some reason.

BloodfrostMessage Me ⸻ 17:49, 18 March 2021 (UTC)

  1. On which wiki does that happen for you? I use AjaxUndo and QuickDiff through RecentChanges as well, but everything is working fine.
  2. This has now been implemented, see the updated documentation for details.
-- Cube-shaped garbage can 20:22, 18 March 2021 (UTC)
1. This happens to me on the Wings of Fire Wiki. I'm not sure if this would affect anything, but my default custom filter results in a specific different link:
2. Great!
BloodfrostMessage Me ⸻ 21:21, 18 March 2021 (UTC)
I've just undone an edit of mine using your filter (but with User namespace added) and AjaxUndo, so it shouldn't affect anything. Could you do Inspect Element on an AjaxUndo link and copy the value from the data-url attribute here, and then switch to the Network tab of your DevTools (inspecting puts you in the "Elements" tab), select the "XHR/Fetch" category and filter by "api.php", then click on the AjaxUndo button, select the request that appeared in your Network tab and copy the contents of its Response tab here as well? Also, does undoing work if you only import QuickDiff and AjaxUndo in your personal JS, and does it work on any other wiki? -- Cube-shaped garbage can 11:51, 19 March 2021 (UTC)
Question: Do the new changes support links on collapsible/refreshing Recent changes?
If QuickDiff supports them, there should be no difference in AjaxUndo with regards to that. -- Cube-shaped garbage can 11:51, 19 March 2021 (UTC)
This is replying to KockaAdmirlal's message regaring inspect element. I'm not sure if there's a way to make it obvious that I'm replying to that and not either of the last two replies — I'm pretty inexperienced with talk pages (sorry!).
Is it possible that something in the latest updates to AjaxEdit's JavaScript could've fixed the problem? I just tried it again and the only problem was that the edit summary popup took a bit to finally appear and that after I clicked its OK button, it took a bit to execute, though both problems may have been due to my Chromebook's not-so-good RAM possibly not fairing well with all of the filter settings for RecentChanges. I'm asking if the update(s) had potentially fixed this somehow because this indefinite-loading-bug had been going on for me for a good bit of time, and because this is the first time I've tried undoing through RecentChanges since the JS was edited.
As for using developer tools, my PC is unplugged due to the house interior being painted — this Chromebook is managed by a school district, and they block inspect element. Would you like me to follow your instructions when the computer is up and running again, or does it not matter now that it seems to be working?
BloodfrostMessage Me ⸻ 01:10, 20 March 2021 (UTC)
You usually reply right below the message you want to be replying to, by indenting one more level than the previous. It's less like how it works on message walls and more like how it works on Reddit. I inserted an HTML comment where your reply should have been.
If you can reproduce the issue on your computer, it would be useful to follow the instructions and provide the data here so I can try reproducing (and fixing) it. -- Cube-shaped garbage can 13:50, 20 March 2021 (UTC)
👍, so even if this bug isn't occurring for me anymore, I should still try to get the data-url and network information? (I don't know if my hastily written message before had really explained well that the bug-where-where-it-kept-loading had stopped.)
BloodfrostMessage Me ⸻ 21:24, 20 March 2021 (UTC)
Well, if it isn't occurring to you anymore, the data-url attribute contents and the API response would be usual, so there would be nothing to investigate there. If it does occur to you, though, you should try gathering these. -- Cube-shaped garbage can 21:37, 20 March 2021 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.