Extension talk:UserMerge

Jump to navigation Jump to search

About this board

It is preferred that you open a regular bug report under the MediaWiki-extensions-UserMerge product for new issues.

UserMerge CannotCreateActorException

Summary by Kghbln

See also the respective mailing list thread

Silkwood (talkcontribs)

My config:

Product Version
MediaWiki 1.33.1 (d35fba2)

15:11, December 17, 2019

PHP 7.2.17-0ubuntu0.18.04.1 (apache2handler)
MariaDB 10.1.38-MariaDB-0ubuntu0.18.04.1
UserMerge 1.10.1 (4b7feed) 08:17, July 24, 2019

trying to delete a user (merging it to Anonymous) I get this error and the following backtrace:

UserMerge CannotCreateActorException from line 2516 of /var/www/w/includes/user/User.php: Cannot create an actor for a usable name that is not an existing user.


#0 /var/www/w/extensions/UserMerge/includes/MergeUser.php(378): User->getActorId(Wikimedia\Rdbms\DatabaseMysqli)

#1 /var/www/w/extensions/UserMerge/includes/MergeUser.php(50): MergeUser->mergeDatabaseTables(string)

#2 /var/www/w/extensions/UserMerge/includes/SpecialUserMerge.php(135): MergeUser->merge(User, string)

#3 /var/www/w/includes/htmlform/HTMLForm.php(660): SpecialUserMerge->onSubmit(array, OOUIHTMLForm)

#4 /var/www/w/includes/htmlform/HTMLForm.php(552): HTMLForm->trySubmit()

#5 /var/www/w/includes/htmlform/HTMLForm.php(567): HTMLForm->tryAuthorizedSubmit()

#6 /var/www/w/includes/specialpage/FormSpecialPage.php(184): HTMLForm->show()

#7 /var/www/w/includes/specialpage/SpecialPage.php(569): FormSpecialPage->execute(NULL)

#8 /var/www/w/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)

#9 /var/www/w/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)

#10 /var/www/w/includes/MediaWiki.php(865): MediaWiki->performRequest()

#11 /var/www/w/includes/MediaWiki.php(515): MediaWiki->main()

#12 /var/www/w/index.php(42): MediaWiki->run()

#13 {main}

Silkwood (talkcontribs)


It was enough to add the following line in LocalSettings.php

// Add just one user name to the default array

$wgReservedUsernames[] = 'Anonymous';

to get this:

Merge from Giada (691) to Anonymous (0) is complete.

Giada (691) has been deleted.

Thanks to Brian Wolff

Merging IP contributions to an user

Tinker Bell (talkcontribs)

Well, that. It's possible to merge the contributions of an IP to an existing account?

Crochet.david (talkcontribs)

no, an IP contribution can be by anybody, even if your have an IPV6 or a static IPv4.

Reply to "Merging IP contributions to an user"

Could this work with version 1.25?

Bmrberlin (talkcontribs)
Zer00CooL (talkcontribs)

I have test UserMerge and work fine with mediawiki 1.32.0

Bmrberlin (talkcontribs)

Thank you, but I asked for version 1.25.@Bmrberlin

Reply to "Could this work with version 1.25?"

How i can purge the content from Spécial:Journal/usermerge

Zer00CooL (talkcontribs)

I would not want to display the actions performed.

- Either hide them from the public

- Or, preferably, be able to delete them by myself.

How to do ?

Can I empty such information from the database?

Where are the information stored?

The Merge and Delete User information is always displayed from Spécial:Journal/usermerge

The same from Spécial:Modifications_récentes

Ciencia Al Poder (talkcontribs)

You can suppress the contents of those logs (the log will be there, but the information not visible to others) if you have the deletelogentry permission (see Manual:User_rights#List_of_permissions)

Ciencia Al Poder (talkcontribs)

A better approach is to add that log to Manual:$wgFilterLogTypes, which would hide them from Special:RecentChanges and Special:Log (unless specifically requested to be shown).

If you don't want them to be visible even when explicitly requested, add it to Manual:$wgLogRestrictions.

Zer00CooL (talkcontribs)

I do not know either of them. I watch.

We do not hesitate to complete here a little information.

To be able to manage the deletion, or, to hide the logs totally, would be a plus for this UserMerge extension.

Thank you for participating in the discussion so quickly.

I had already tested Logrestriction but I was not able to get what I wanted, to properly hide UserMerge logs, to non-connected users and to single users.

Test 1 # KO

An intermediate solution would be to disable the extension once the merges and deletions have been made.

If the extension is disabled, "log-name-usermerge" is displayed instead of "User Account Merge Log".

A single line will then be displayed in the last changes since Mediawiki: "18:25 (⧼log-name-usermerge⧽). [Zer00CooL (46 ×)]"

Even so, the pages I post on another site with an RSS feed continue to serve the information, a line for each profile that has been merge and deleted.

Disabling the extension is therefore useless. I leave the extension enabled.

Test 2 # KO

# Do not display the UserMerge logs.

$ wgLogRestrictions = ['usermerge' => 'bureaucrat'];

# Bug 1

# Works in part since Special: Journal

The logs are not displayed.

The logs are not displayed either with my connected bureaucrat user.

# Bug 2

# Error from Special page: Journal / usermerge

You can not ⧼action-bureaucrat⧽, for the following reason:

You do not have sufficient rights to perform the requested action.

Test 3 # KO

Another alternative would be to use Lockdown but still it does not seem to work.

I am not on options to indicate, I try "usermerge" to forbid to "user" but the users always have access to the information of journaling, in particular, on "Latest modifications".

I found how to hide all the "last changes" but this is not the purpose of hiding all the changes, only the merge and deletion of user account.


I may not use the right configurations, I do not know how to move on now.



I would then search the database for "deleted the user account" or "log-name-usermerge" or "usermerge".

See if it is possible to delete these kind of entries directly from the database.

# I think it would have been better to use the CleanMediawiki.sh script to delete users. I did not test it. https://github.com/ZerooCool/cleanmediawiki

My research in French on UserMerge :


Zer00CooL (talkcontribs)

OK with this adds to the LocalSettings.php

$wgGroupPermissions['sysop']['deletelogentry'] = true;

$wgGroupPermissions['sysop']['deleterevision'] = true;


The RevisionDelete extension allowed me to replace the UserMerge logging information with neutral information. I would have preferred to delete UserMerge's logging information but the RevisionDelete extension still looks interesting. The history is preserved. The irrelevant information is neutralized.


I guess I can rely on the CleanMediawiki.sh script to learn more about how to clean mediawiki by going through this script.

Nevertheless, the issue remains open if anyone can explain to me with an example adapted to UserMerge, how to delete ALL the logging data of UserMerge.

Reply to "How i can purge the content from Spécial:Journal/usermerge"

How do you actually delete users

Jamiehutber (talkcontribs)

I have tried and tried using:

`%login%, AAHWayne00562260`



But both result in the same error as seen in the error

My problem is that I have some 27k fake user accounts, so I opted for the comma seperated, this doens't appear to work.

So how can I delete all 27k banned users?

Zer00CooL (talkcontribs)

Add a captchap to slow down spam


You can read this to clean mediawiki spam


Look to delete inactif user too


You can look this




Zer00CooL (talkcontribs)

You can test, and, confirm, the best is Cleanmediawiki ut, it's not a officiel repo. Why ? I don't know.

Zer00CooL (talkcontribs)

I have test UserMerge and work fine with mediawiki 1.32.0

I can only delete one user at a time, return to the merge form to delete a second user, return to the form, and so on ...

It's a good tool, but slow, if you have multiple users to delete.

Reply to "How do you actually delete users"

Error: 42P01 ERROR: relation "ignore" does not exist

1 (talkcontribs)

Hi, i've Postgress

Reply to "Error: 42P01 ERROR: relation "ignore" does not exist"
Daniel schuerhoff (talkcontribs)


UserMerge logs every merger, which usually makes sense and is a good functionality. However sometimes you don't want the merge to be displayed (e.g. when you use it to get GDPR compliance, by merging users into a 'DeletedUser' or similar). In that case you do not want the old username to appear in any log, since the point is to remove all that user's personal data (including his username).

Is there a possibility to switch logging of in LocalSettings or vial button in the UserMerge menu?

Best, Daniel

Planetenxin (talkcontribs)

Yes, it would be nice to have something like

$wgUserMergeNoLog = true;
Daniel schuerhoff (talkcontribs)

What I did as a temporary Workaround, I went into the files that create the logs and replaced the (first?) username for all merges with 'merged user' und 'deleted user' for the deletions.

With a switch would be nicer, but that is a possibility. Maybe if I have some time, imma implement a simple if-case for a variable like that and do a PR.

Reply to "Logging Control"

Feature Request: User Page Redirect?

AJ Quick (talkcontribs)

Would it be possible to add an automatic redirect to the User page and User talk page? It would be good that things remain connected.

Reply to "Feature Request: User Page Redirect?"
Tribly (talkcontribs)

Is there a way to restore a deleted user? (talkcontribs)

no, the user to be merged is deleted from the user table. the person will have to recreate the account, everything will have been lost. be careful when using this.

Summary by Ciencia Al Poder
Blakegripling ph (talkcontribs)

OK, let's say that I want to get rid of a swath of spambot accounts from my wiki by using this tool. I can do that one at a time, but the problem is that there are over 9000 junk accounts that I want to get rid of, and yet doing it one per user is way too tedious. Blakegripling ph (talk) 08:12, 30 June 2012 (UTC)

Spellcoder~mediawikiwiki (talkcontribs)

I've too had a need for such a tool, so I've been working on a version of UserMergeAndDelete which can do mass merging to get rid of all the spam accounts on my AmigaCoding wiki. It's still experimental, though it works (just merged 488 accounts with it). It works by entering/copy&pasting a list of usersnames which can be comma-seperated or have each username on a new line (on each line ignore the part after a tab character so I can copy&paste from MySqlAdmin and remove the first columns using blockselection in a texteditor and columns after the username can be ignored). If there's interest in it I might place it only somewhere this month. Spellcoder (talk) 02:19, 14 August 2012 (UTC)

This post was posted by Spellcoder~mediawikiwiki, but signed as Spellcoder.

Blakegripling ph (talkcontribs)

My wiki hasn't been swamped with junk accounts lately, but I might find some use for this, and also in that OSX86 wiki to which I'm an administrator.

Geos one (talkcontribs)

i am interested too plz post thx Mario

Viswaprabha (talkcontribs)

I have a little awkward way to accomplish the bulk merge through a work-around. Hope someone would find it useful! (Must have a little string concatenation skills in spreadsheets; or one may use a python or similar script; or use a text editor with bulk replacement features)

1. Prepare a list of all SPAMuserIDs, store them in a spreadsheet or textfile.

2. The post method used for submitting the Merge & Delete User form (by clicking the button) should be converted to a get method. This will get us a long URL. See the second comment (by Matthew Simoneau) dated 13/Jan/2009) at http://www.mathworks.com/matlabcentral/newsreader/view_thread/242300 for the method.

The resulting URL string should be something like below:

http: //(Your Wiki domain)/Special:UserMerge?olduser=(OldUserNameHere)&newuser=(NewUserNameHere)&deleteuser=1&token=0d30d8b4033a9a523b9574ccf73abad8%2B\

2. Now, divide this URL into four sections:

A: http: //(Your Wiki domain)/Special:UserMerge?olduser=
B: (OldUserNameHere)
C: &newuser=(NewUserNameHere)&deleteuser=1
D: &token=0d30d8b4033a9a523b9574ccf73abad8%2B\

3. Now using a text editor or spreadsheet, prefix each spam userIDs with part A and Suffix each with Part C and D. Part C will include the NewUser(which is a specially created single dummy userID). The Part D, the Token string is a session-dependent token that will be changed per user per session. So you will need to get a new token every time a new session/batch of work is required.

4. With the above step, you should get a long list of URLs, each good to do a Merge&Delete operation for one user. We can now create a simple HTML file, view it and use a batch downloader like DownThemAll in Firefox.

Add two more pieces "<a href=" and "> Linktext</a>" to each line at beginning and end. Also add <html><body> at top and </body></html> at bottom and save the file as (for eg:) userlist.html

5. Open the file in Firefox, use DownThemAll add-on and download all the files! Effectively, you are visiting the Merge&Delete page for each user and clicking the button!

Although this might look a lengthy and tricky job at first, once you follow this method, you can remove tens of thousands of users without much manual efforts.

You can verify if the operation is going well by opening some of the downloaded html files (or by looking through the recent changes in another window). One advantage is that it does not directly edit the MySQL pages. Nor does it require direct database access. List of spam users may be prepared from the user creation logs. If you do have the dB access, the Wiki_user table can be imported into a local list.

Viswaprabha (talk) 20:57, 2 February 2013 (UTC)

Blakegripling ph (talkcontribs)

That method looks crude, but it seems 'swell for admins who are getting jaded at the sheer amount of database-wasting spambot accounts.

Papalotzincoatl (talkcontribs)

Thanks Viswaprabha! Here is below a Python script to concatenate the pieces above and produce the html page to use with DownThemAll! By the way, in my case the URL string that worked uses 'Special:UserMerge&olduser=', with an & in that part instead of the ? in your example.

# Concatenate a list of users to produce URLs which delete them using UserMerge Extension for MediaWiki
# Usage:  python concatenate_UserMerge_MediaWiki.py userslist.txt > userURLlist.html  

import sys

input = open(sys.argv[1])
count = input.readlines()
g = len(count)

print "<html><body>"

input = open(sys.argv[1])

for k in range(g):
        line = input.readline()
        print "<a href=\""+"http://(Your Wiki Domain)/index.php?title=Special:UserMerge&olduser="+line+"&newuser=Anonymous&deleteuser=1"+"&token=2c05d520d9b202235c03e8fe8ll8khB\\\""+">User URL Link</a>"


print "</html></body>"
Viswaprabha (talkcontribs)

Thank you for that Python script. Never thought my 2 cents would be this useful and appreciable! :)

Uwe a (talkcontribs)

Seems this code stopped working, its not working for me (I get the UserMege special page with emtpy fields) --Uwe a (talk) 22:53, 10 May 2015 (UTC)

Blakegripling ph (talkcontribs)

Yeah the workaround Viswaprabha came up with no longer seems to work. :/