This page can be used to request edit filters, or changes to existing filters. Edit filters are primarily used to address common patterns of harmful editing.
Private filters should not be discussed in detail. If you wish to discuss creating an LTA filter, or changing an existing one, please instead email details to wikipedia-en-editfilterslists.wikimedia.org.
Otherwise, please add a new section at the bottom using the following format:
== Brief description of filter == *'''Task''': What is the filter supposed to do? To what pages and editors does it apply? *'''Reason''': Why is the filter needed? *'''Diffs''': Diffs of sample edits/cases. If the diffs are revdelled, consider emailing their contents to the mailing list. ~~~~
Please note the following:
Index |
This page has archives. Sections older than 30 days may be automatically archived by ClueBot III when more than 1 section is present. |
I wish to log edits where editors add Wikipedia:
, WP:
, Help:
(case insensitive) inside of <sup></sup>
to check the extent to which new editors use raw text instead of actual maintenance tags, and if a bot will be required for regular maintenance of this or not. Thanks! —CX Zoom[he/him] (let's talk • {C•X}) 21:35, 31 May 2025 (UTC)
added_lines contains "<sup>[''[[Wikipedia:"
equals_to_any(page_namespace, 0) &
added_lines irlike "<sup>(\[|[)\'\'\[\[(Wikipedia|Help|WP|H)\:"
equals_to_any(page_namespace, 0)
, we could just use page_namespace == 0
since there is only one namespace being checked here. – PharyngealImplosive7 (talk) 07:37, 12 June 2025 (UTC)
!removed_lines
as well:equals_to_any(page_namespace, 0) &
!("bot" in user_groups) &
(
nope := "<sup>(?:\[|[)''\[\[(?:Wikipedia|Help|WP|H):";
added_lines rlike nope &
!(removed_lines rlike nope)
)
pattern :="<sup>(?:\[|[)''\[\[(?:Wikipedia|Help):";
equals_to_any(page_namespace, 0, 2, 118) &
!contains_any(user_groups, "sysop", "bot") &
added_lines irlike pattern &
!(removed_lines irlike pattern)
user_editcount
for example, but not sure it really matters. Nobody (talk) 12:59, 24 June 2025 (UTC)
Duckmather (talk) 00:38, 3 June 2025 (UTC)
page_last_edit_age
(if it's not null
, then the page exists) but I'm not sure. The mobile app constraint is fairly easy to check (the AbuseFilter extension) has a variable user_app
built into it for this exact purpose.{{flag}}
and {{flagicon}}
templates which isn't possible as far as I know. A similar issue occurs with the wikiproject tags issue you bring up; the AbuseFilter can not cross-reference a module as far as I know. I also don't think checking if someone has properly closed template brackets or otherwise is possible with the AbuseFilter in a feasible way; the logic would be pretty complex and would still produce a lot of FPs. – PharyngealImplosive7 (talk) 03:50, 3 June 2025 (UTC)
new_html
variable, which uses parsing to detect whether templates exist or not. For example, if I were to write {{fake example}}
, this would translate into HTML as <a href="/w/index.php?title=Template:Fake_example&action=edit&redlink=1" class="new" title="Template:Fake example (page does not exist)">Template:Fake example</a>
. You could in turn detect this redlink using the regex <a href="\/w\/index\.php\?title=Template:[^"]*\;redlink=1\" class=\"new\"
. Of course, this line of code by itself would generate false positives, as wikilinking a nonexistent template the usual way will also produce identical HTML, so it would need some refining. But I don't see any fundamentally technical barriers preventing you from pulling this off. Duckmather (talk) 04:37, 3 June 2025 (UTC)
new_html
is a large variable, so ideally it should be placed at the end of any filter for performance reasons. I believe that my point of detecting if someone has left brackets closed or not is unfeasible still stands though. – PharyngealImplosive7 (talk) 06:07, 3 June 2025 (UTC)
- wikitext_template := "{{[^\||\n|}]*(\||\n|}})";
- common_template := "(?x){{(?:
- !
- |[Aa]nchor
- |[Aa]s\ of|[Aa]uthority\ control
- |[Bb]irth\ date(?:\ and\ age)?
- |[Bb]lockquote
- |[Cc]-SPAN
- |[Cc]bignore
- |[Cc]irca
- |[Cc]itation needed
- |[Cc]ite\ (?:AV\ media|book|conference|encyclopedia|interview|journal|magazine|news|press\ release|tweet|web)
- |[Cc]lear
- |[Cc]n
- |[Cc]oord
- |[Ee]fn
- |[Ee]?m(?:dash)?
- |[Ff]urther
- |[Gg]Burl
- |[Gg]loss
- |[Gg]oogle\ [Bb]ooks(?:\ URL)?
- |[Hh]arvnb
- |[Ii]PAc-(?:ar|cmn|en|hu|pl|yue)
- |(?:ISBN|isbn)\??
- |[Ii]nfobox\ (?:album|book|company|film|football\ biography|musical\ artist|NRHP|officeholder|person|settlement|song|television)
- |[Ll]angx?
- |[Ll]egend
- |[Mm]ain
- |[Mm]ath
- |[Mm]dash
- |[Mm]ultiple\ image
- |[Nn]bsp
|[Nn]owrap
- |[Oo]fficial\ website
- |[Pp]lainlist
- |[Pp]p(?:-(blp|dispute|extended|semi-indef|sock|vandalism))?
- |[Pp]roQuest
- |[Rr]ef(?:begin|end|h|list)
- |[Ss]fnm?
- |[Ss]hort\ description
- |[Tt]OC\ limit
- |[Uu]se\ (dmy|mdy)\ dates
- |[Uu]se\ (American|Australian|British|Canadian|Hong\ Kong|Indian|Jamaican|Kenyan|Liberian|New\ Zealand|Nigerian|Pakistani|Philippine|Singapore|South\ African|Sri\ Lankan|Trinidad\ and\ Tobago|Ugandan)\ English
- |[Ww]ebarchive
- |[Ww]ikiProjectBannerShell
- |[Ww]ikiProject\ (Albums|Anthroponymy|Australia|Articles\ for\ creation|Biography|Canada|Cities|banner\ shell|Disambiguation|Football|Film|France|Germany|India|Lepidoptera|Lists|Military\ history|Olympics|Songs|Television|United\ States)
- )\s*(?:\||\n|}})";
- nonexistent_template = '<a href="\/w\/index\.php\?title=Template:([^" ]*)\;redlink=1\" class=\"new\"';
wikitext_template
catches the use of any template in wikitext; common_template
catches various commonly used templates; and nonexistent_template
catches a HTML link to a nonexistent template. Part of why this took so long is that I had to try several different things before I could get a satisfactory list of common templates.)
- added_lines rlike wikitext_template &
- rcount(common_template, added_lines) < rcount(wikitext_template, added_lines) &
- new_html rlike nonexistent_template
- equals_to_any(page_namespace, 0, 1, 118) &
- rcount(common_template, added_lines) < rcount(wikitext_template, added_lines) &
- new_html like nonexistent_template &
- (
- !(contains_any(user_groups, "autoconfirmed", "bot", "confirmed"))
- | user_mobile
- | user_app
- | (summary rlike "^Created by translating the page" & page_id == 0)
- | new_html rlike '<a href="\/w\/index\.php\?title=Template:[^" ]*(cite|https?:\/\/|doi|isbn|(IPA|lang-)[\w-]+|\w+\ icon|wikiproject|[^\x00-\xFF\s–—])[^" ]*\;redlink=1\" class=\"new\"'
- ) &
- !(summary irlike "restor(?:ed?|ing)|revert(?:ed|ing)?|und(?:o|id)" & page_id != 0)
class="new" title="Template:
in the new_html
also work? Nobody (talk) 05:57, 23 June 2025 (UTC)There's a fair bit of disruptive edit warring around Igboid and Ijaw languages and cultures, swapping them back and forth without sources. The most recent editor has been making edits primarily removing claims of Igbo heritage and inserting other ethnic names, most commonly Ijaw. [1][2][3] However, articles in this space have significant editing in the opposite direction as well, with some editors inserting claims of Igbo heritage into articles in the place of other ethnic groups. [4][5][6]
I'm interested in helping out more with edit filters so I've tried to draft one below. It's my first time requesting an edit filter so I'm not sure if it's possible to handle both "Ijaw" → "Igbo" and "Igbo" → "Ijaw", etc.
!contains_any(user_groups, "extendedconfirmed", "sysop", "bot") &
page_namespace == 0 &
(
ethnic_groups := "(?i)ijaw|ijo|igbo|igboid|igboland|edo|edoid";
/ * ethnic group names present both before and after edit */
added_lines rlike ethnic_groups & removed_lines rlike ethnic_groups
)
Dan Leonard (talk • contribs) 17:15, 3 June 2025 (UTC)
irlike
also exists for case-insensitive marking. The current filter would also match someone adding/removing names of the same ethnic group. Here is a revised version of the filter:!contains_any(user_groups, "extendedconfirmed", "sysop", "bot") & page_namespace == 0 & ( igbo_text := "\sigbo(?:id|land)?\s"; ijaw_text := "\sij(?:aw|o)\s"; edo_text := "\sedo(?:id)?\s"; sourcing := "\{\{[Cc]ite\b|(?i)<ref(?:\s[^>]*?)?/?>"; rcount(sourcing, added_lines) <= rcount(sourcing, removed_lines) & ( added_lines irlike igbo_text & (removed_lines irlike ijaw_text | removed_lines irlike edo_text) ) ^ ( added_lines irlike ijaw_text & (removed_lines irlike igbo_text | removed_lines irlike edo_text) ) ^ ( added_lines irlike edo_text & (removed_lines irlike igbo_text | removed_lines irlike ijaw_text) ) )
added_lines irlike "\b(group1|group2|group3)\b"
as a pre-filter. Going straight to two rcount
calls for any new user edit in article space would probably be more expensive than ideal. In the interior of the filter, it might be good to do counts on each ethnic group somewhat like 1338 (hist · log) then use some logic around numeric comparisons (I'm not sure about using XOR, but I'd want to test a filter on a lot more unique examples). @Dan Leonard: Could you dig up more example edits? The more unique edits from different users that we have to test, the better our initial filter will be. Thanks. Daniel Quinlan (talk) 22:27, 4 June 2025 (UTC)Not sure if this has been recommended before, but it's a pretty common vandalism pattern to just click "undo" on rollbacks/undos performed by tools like Twinkle, Huggle, RedWarn, etc. Is it worth considering a filter that would prevent new users from using the undo tool to reverse these edits? Ed (talk) 21:54, 3 June 2025 (UTC)
Duckmather (talk) 14:43, 22 June 2025 (UTC)