Jump to content

Wikipedia talk:AutoWikiBrowser

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Wikipedia talk:AutoWikiBrowser/Tasks)
Latest comment: 1 day ago by Helpful Cat in topic Searching for empty section headings

Start a new discussion

This is the discussion page for the AutoWikiBrowser (AWB) project. It is also the place to discuss using the AWB program (for help, questions, or general inquiries about AWB). Specific guidelines on where to make particular reports or requests are provided in the § Before you post section below. Before asking a question, please refer to the read the § Frequently asked questions below.

Before you post

[edit]
Do you want to ...Please use
Report a bug or request a feature in AWB?Check reported bugs on Phabricator before filing a new bug report. You do not need to create another account there; just log in with your global Wikimedia account. See this MediaWiki wiki page on how to report bugs and request features on Phabricator.
Report an incorrectly fixed typo?Wikipedia talk:AutoWikiBrowser/Typos
Request approval to use AWB?Wikipedia:Requests for permissions/AutoWikiBrowser
Ask a question about AWB or ask for help?This page

Frequently asked questions

[edit]

Discussion

[edit]

Find instances of an article's title in the body

[edit]

Per title, is there any way to do this with find and replace, without setting up a new rule for each article? Can magic words be used for this? One use case would be wrapping instances of the title in {{lang}} templates in articles about foreign words (e.g. those in subcategories of Category:Words and phrases by language), per MOS:LANG. Thanks! Helpful Cat🐈 02:04, 5 October 2026 (UTC)Reply

@Helpful Cat: Yes, there are some magic strings that you can include in your "Find" and "Replace" strings; see the table at Wikipedia:AutoWikiBrowser/Find_and_replace#Normal_settings. -- John of Reading (talk) 06:45, 5 October 2026 (UTC)Reply
Amazing, thank you! Helpful Cat🐈 06:48, 5 October 2026 (UTC)Reply
Do you know if there's a way to respect the original case when using these magic strings? Let's say I'm finding %%title%% and replacing it with {{lang|af|%%title%%}} (for Afrikaans text). Is there a way for lowercase instances of the title to remain lowercase?
I know there's a case-sensitive setting, but I would like to find all occurrences of the title regardless of case. Thanks! Helpful Cat🐈 12:55, 5 October 2026 (UTC)Reply
@Helpful Cat: Try finding (%%title%%), replacing with {{lang|af|$1}}, with "case sensitive" turned off and "regex" turned on. The round brackets tell the find+replace code to remember what it matched and the $1 prints it out again. -- John of Reading (talk) 13:59, 5 October 2026 (UTC)Reply
Amazing, looks like that works. Thank you! Helpful Cat🐈 14:13, 5 October 2026 (UTC)Reply

Prepend unless already there

[edit]

Is there a way to have AWB prepend text unless that text is already present? I know there's the option to skip pages that contain certain text, but I don't necessarily want to skip those pages entirely, because there are also other changes I'm making. Thanks! Helpful Cat🐈 10:22, 5 October 2026 (UTC)Reply

Wait, it removes the duplicate automatically, so maybe this question wasn't necessary:
Wow! Helpful Cat🐈 10:31, 5 October 2026 (UTC)Reply

One-time find and replace

[edit]

Is there a way to find and replace within the edit box, without making it a rule? Let's say I'm finding (%%title%%) and replacing it with {{lang|af|$1}} (to tag it as Afrikaans text as I described above). By default, this also italicises the text. Let's say in one specific article, the text should not be italicised because it's a proper name, so I need to add |italic=no to the lang template. However, I don't want to make it a rule that (%%title%%) should always be replaced with {{lang|af|$1|italic=no}}, because the text should be italicised in most articles. Is there a way to find instances of the template in the edit box and replace them with the italic=no version? I see there is a find function for the edit box, but I don't see a replace function. Thanks! Helpful Cat🐈 11:04, 7 October 2026 (UTC)Reply

@Helpful Cat: No, I don't there's a direct way to do this. One workaround would be to grab the text from the edit box and paste it into an external editor such as Notepad++, use that editor's find and replace, and paste it all back into AWB. Or, if I thought that "one-time" might well turn into "ten or a dozen times", I'd set up a second find and replace rule, and use the "Enabled" column to switch on whichever was appropriate for the current article. -- John of Reading (talk) 12:10, 7 October 2026 (UTC)Reply
Thank you! Helpful Cat🐈 12:18, 7 October 2026 (UTC)Reply
You might be able to get it done with a greedy ([\s\S]+) after the search term so that it pulls everything after the match, and then make sure a $2 is included in the replace. The first match would catch everything on the page, but if you have it set to only find once it won't iterate to later text. Primefac (talk) 23:07, 9 October 2026 (UTC)Reply
Thanks! Sorry, I'm not familiar with regex and don't think I understand you. Where should I put the ([\s\S]+) and the $2, in the same rule or a new one? How would that help me replace the lang templates with the italic=no version? Thanks again for your help. Helpful Cat🐈 08:44, 10 October 2026 (UTC)Reply
It would be (%%title%%)([\s\S]+) replacing with {{lang|af|$1}}$2. \s is a whitespace character, and \S is a non-whitespace character, so the [\s\S]+ check is basically "any/all characters after this". Primefac (talk) 15:17, 10 October 2026 (UTC)Reply
Thanks. Sorry, I'm still missing something - how would that help me replace the lang templates with the italic=no version? Wouldn't that just replace the page's content after the first instance of the title with itself? Helpful Cat🐈 15:34, 10 October 2026 (UTC)Reply
I think I might have misread your initial query. Are you looking to replace all instances of the page title with the {{lang}} variant, and only on some articles you want to add the |italic=no? Assuming you're not using a bot, just have two rules set up, one with the italic and one without. If it's a page that needs the no italics, enable that rule, otherwise keep it disabled. Primefac (talk) 16:37, 10 October 2026 (UTC)Reply
Are you looking to replace all instances of the page title with the {{lang}} variant, and only on some articles you want to add the |italic=no? Yes, that's it. My initial query was whether there is a one-time find and replace function for the edit box so that after the (%%title%%) to {{lang|af|$1}} rule runs, I can replace {{lang|af|$1}} with {{lang|af|$1|italic=no}}. I see that creating two rules is the best solution to this. Thanks again! Helpful Cat🐈 01:09, 11 October 2026 (UTC)Reply

When is the bot flag added to edits?

[edit]

Hi. I keep forgetting when the bot flag is added to edits. I haven't found this in the FAQ.

I made some edits on plwiki using a bot password for my main account, but they were not marked as bot edits.

  • I had the flooder flag on my account.
  • I am on the enabled bots list.
  • The bot password had "High-volume (bot) access" granted.
  • In some edits I even added "minor edit" option and that didn't help.

So I'm in a bit of trouble... and also don't know what triggers the flag? Example edit EcceNux (talk) 21:15, 10 October 2026 (UTC)Reply

Bots are flagged as such with a specific user right. If you're using your main account, chances are good it won't be flagged as a bot because your main account is (I am guessing) not a bot. Primefac (talk) 21:43, 10 October 2026 (UTC)Reply
"Bot password" is a misleading misnomer. In other contexts it's an "application password", intended for use with a high-complexity password in contexts where a regular username/password won't work. If you're logging in with a username that has an "@" prefix it gets you a little extra privilege (like evading the IP check on login). David Brooks (talk) 11:34, 12 October 2026 (UTC)Reply

General fixes adding incorrect birth categories

[edit]

Prompted by the database report at Wikipedia:Database reports/Unbelievable life spans, I'm seeing a slow-motion edit war with the AWB general fixes. Is there anything that can be done to...

...to stop the general fixes adding incorrect birth categories? In four of these cases the actual birth is BC, but AWB is adding an AD category; in the final case the birth year in the lead sentence is marked "SH", Solar Hijri calendar. -- John of Reading (talk) 14:18, 14 October 2026 (UTC)Reply

Split database dump files

[edit]

If you use the "Database scanner", read on.

The Mediawiki team has started providing database dumps as a sequence of compressed XML files alongside the previous single, unwieldy file. Starting in January 2027 they will stop producing the single file.. You can still scan each file in sequence, but I have made a change that automates it for you; once you select a single XML file, AWB will offer to stream all the XML files in the same directory in one pass. Feel free to give it a go and let me know what you think. There are a couple of error conditions that need to be handled better, and some potential UI changes.

I'm traveling, so responses may not be swift.

Get it from https://github.com/DavidWBrooks/UnofficialAWB/releases/latest; as usual buyer beware and remember to unlock the downloaded files first. David Brooks (talk) 21:10, 20 October 2026 (UTC)Reply

And it was remiss of me not to mention the help I got from John of Reading in testing and feedback. David Brooks (talk) 21:42, 20 October 2026 (UTC)Reply

Sub-reference

[edit]

Thanks David for addressing the sub-reference issue (T434983). That alone is sufficient reason for users to install the latest version of 6501 (October, 2026). Neils51 (talk) 00:16, 29 October 2026 (UTC)Reply

I think it alone is reason to ask the official owners for a mandatory update! I expect there are a number of users running with general fixes on, and may not notice the damage that is guaranteed to happen as more enwiki editors discover subrefs. I'll put up a bat-signal. David Brooks (talk) 03:37, 29 October 2026 (UTC)Reply

All AWB users - subrefs alert!

[edit]

The new subref feature has been rolled out to enwiki (it's been on other wikis for a while); please note that genfixes will damage them. For now, take extra care and check the initial diffs for something like <ref name="Moser 2010" details="p. 791"/> becoming <ref name="Moser 2010 details=p. 791"/>. Undo such changes.

For now, if you are willing and able, you can use my version on github, shown above. David Brooks (talk) 03:45, 29 October 2026 (UTC)Reply

I just replaced mine. Thank you for your work on this. the Stefen 𝕋ower 04:23, 29 October 2026 (UTC)Reply
For example I just did a search for insource:/ref name=\"[^\"]+ details=/ and it came up with two examples. @Ar1201u1: see St Mary's Church, Breamore (broken in several places) and @GünniX: see MidAmerica Productions (two breaks). Sorry about this. David Brooks (talk) 04:28, 29 October 2026 (UTC)Reply
Thank you, I've fixed my error. --GünniX (talk) 04:36, 29 October 2026 (UTC)Reply
Thank you for the update, I have reverted the change for now, I will switch before using it the next time Ar1201u1 (talk) 04:42, 29 October 2026 (UTC)Reply

Can AWB create a list of redirects or disambiguation pages on a page?

[edit]

AWB can create lists using Links on page (only bluelinks) and Links on page (only redlinks). Is there a way using AWB or otherwise to create lists of links on a page which go to redirects or disambiguation pages? In my common.css page, or somewhere, I've set redirects to be colored green and links to disambiguation pages to be colored orange, so I know the destination of those links can be communicated back to the page. Thanks, SchreiberBike | ⌨  01:52, 31 October 2026 (UTC)Reply

Searching for empty section headings

[edit]

Is it possible to search for articles with empty section headings, in order to either tag or remove them? In particular, I'd like to remove empty external links sections. Thanks! Helpful Cat🐈 10:08, 31 October 2026 (UTC)Reply

@Helpful Cat: This is tricky, as it is hard to classify an External Links heading followed by a template call. If the template is a random navbox, the heading may be redundant, but if it is a template that generates an external link, the heading is needed. My regular expression for this task recognises just a few templates that don't generate external links:

\n== *External\s+[Ll]inks *==((\n<!-- Use the format: \* ?\[http://www\.example\.com/ example\.com\] -->)|(\n<!-- Per \[\[WP:ELMINOFFICIAL\]\], choose one official website only -->)|\n\*\s*)*(?=(?:\s|<!--(?:(?!-->).)*--\>|\{\{DEFAULTSORT:[^\}]*\}\}|\[\[[Cc]ategory:[^\]]+\]\]|\{\{[Aa]uthority\s+control\}\}|\{\{[Cc]oord\|(?!\b[^\}]{1,99}inline\b)[^\}]{1,99}\}\}|\{\{[Cc]oord\s*missing\|[^\}]{1,99}\}\}|\{\{[Pp]ortal\s*bar\|[^\}]{1,99}\}\}|\{\{[Tt]axon\s*bar\|[^\}]{1,99}\}\}|\{\{[Uu]se\s+\w+\s+dates\|date\s*=\s*\w+\s+\d+\}\}|\{\{[Uu]se\s+\w+\s+English\|date\s*=\s*\w+\s+\d+\}\}|\{\{[A-Za-z0-9-]+-stub\}})*$)

The idea is to parse everything from the heading downwards, skipping "safe" templates, the DEFAULTSORT, the categories, and so on, and if it gets to the end of the article, the $, then the heading is not needed. Of course this is too complicated for the usual search tools, and I use the AWB database scanner. I've actually run this on the October 2026 dump, so most of the matches for that regex have been fixed. -- John of Reading (talk) 10:38, 31 October 2026 (UTC)Reply
Thank you! Helpful Cat🐈 11:04, 31 October 2026 (UTC)Reply