Hi all,
I'm trying to automate wrangling protection templates. Adding them is trivial, but I'm having issues with the removal. The best I have is go waaay back on protections, check the expiration date and see if the page is still protected. But that's both expensive and useless for long-term protections.
Is there any event/notification/anything at all available through the API that would allow me to know which pages' protection expired recently without keeping a list of protected pages?
Thanks, Strainu
Take a look at enwiki’s Module:Protection banner. It has some code for this
On Tue, Oct 7, 2025 at 9:07 AM Strainu strainu10@gmail.com wrote:
Hi all,
I'm trying to automate wrangling protection templates. Adding them is trivial, but I'm having issues with the removal. The best I have is go waaay back on protections, check the expiration date and see if the page is still protected. But that's both expensive and useless for long-term protections.
Is there any event/notification/anything at all available through the API that would allow me to know which pages' protection expired recently without keeping a list of protected pages?
Thanks, Strainu _______________________________________________ Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
Thanks a lot for the response John! Unfortunately the module itself assumes the title of the page is known, which is exactly what I'm missing. However, if nothing better comes up, I'll just use the tracking category for unprotected pages. Probably not perfect, but better than what I had.
Strainu
În mar., 7 oct. 2025 la 17:04, John phoenixoverride@gmail.com a scris:
Take a look at enwiki’s Module:Protection banner. It has some code for this
On Tue, Oct 7, 2025 at 9:07 AM Strainu strainu10@gmail.com wrote:
Hi all,
I'm trying to automate wrangling protection templates. Adding them is trivial, but I'm having issues with the removal. The best I have is go waaay back on protections, check the expiration date and see if the page is still protected. But that's both expensive and useless for long-term protections.
Is there any event/notification/anything at all available through the API that would allow me to know which pages' protection expired recently without keeping a list of protected pages?
Thanks, Strainu _______________________________________________ Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
If you embed that module in the protection template you can achieve what you need. It’s what enwiki already does.
On Tue, Oct 7, 2025 at 12:04 PM Strainu strainu10@gmail.com wrote:
Thanks a lot for the response John! Unfortunately the module itself assumes the title of the page is known, which is exactly what I'm missing. However, if nothing better comes up, I'll just use the tracking category for unprotected pages. Probably not perfect, but better than what I had.
Strainu
În mar., 7 oct. 2025 la 17:04, John phoenixoverride@gmail.com a scris:
Take a look at enwiki’s Module:Protection banner. It has some code for this
On Tue, Oct 7, 2025 at 9:07 AM Strainu strainu10@gmail.com wrote:
Hi all,
I'm trying to automate wrangling protection templates. Adding them is trivial, but I'm having issues with the removal. The best I have is go waaay back on protections, check the expiration date and see if the page is still protected. But that's both expensive and useless for long-term protections.
Is there any event/notification/anything at all available through the API that would allow me to know which pages' protection expired recently without keeping a list of protected pages?
Thanks, Strainu _______________________________________________ Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
Hi Strainu,
This touches on an issue with the internal representation of "protection changed" event. I filed a ticket for fixing it https://phabricator.wikimedia.org/T406751. Thanks to Tgr for bringing it to my attention.
Having a MediaWiki domain event fire when protection expires wouldn't directly solve your problem, but it would make it possible to eventually include it in a public event stream of some sort.
Cheers, daniel
Am 07.10.2025 um 15:06 schrieb Strainu:
Hi all,
I'm trying to automate wrangling protection templates. Adding them is trivial, but I'm having issues with the removal. The best I have is go waaay back on protections, check the expiration date and see if the page is still protected. But that's both expensive and useless for long-term protections.
Is there any event/notification/anything at all available through the API that would allow me to know which pages' protection expired recently without keeping a list of protected pages?
Thanks, Strainu
Wikitech-l mailing list --wikitech-l@lists.wikimedia.org To unsubscribe send an email towikitech-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
Thanks for picking this up Daniel!
Page protections seem to lag a bit behind other administrative tools in terms of easy of use/data availability, so any work in that area is welcome even if not immediately useful. I'll make sure to log the other weird stuff in Phabricator so the team can get an idea of the gap.
Best, Strainu
În mie., 8 oct. 2025 la 18:53, Daniel Kinzler dkinzler@wikimedia.org a scris:
Hi Strainu,
This touches on an issue with the internal representation of "protection changed" event. I filed a ticket for fixing it https://phabricator.wikimedia.org/T406751. Thanks to Tgr for bringing it to my attention.
Having a MediaWiki domain event fire when protection expires wouldn't directly solve your problem, but it would make it possible to eventually include it in a public event stream of some sort.
Cheers, daniel
Am 07.10.2025 um 15:06 schrieb Strainu:
Hi all,
I'm trying to automate wrangling protection templates. Adding them is trivial, but I'm having issues with the removal. The best I have is go waaay back on protections, check the expiration date and see if the page is still protected. But that's both expensive and useless for long-term protections.
Is there any event/notification/anything at all available through the API that would allow me to know which pages' protection expired recently without keeping a list of protected pages?
Thanks, Strainu
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.orghttps://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
-- Daniel Kinzler Principal Software Engineer MediaWiki Engineering Group Wikimedia Foundation
What about building a lightweight database, e.g. SQLite? You can directly query the expired pages, and sometimes (not at every run) check the other pages, decreasing the cost.
By the way, MediaWiki has recently gained the ability to display protection indicators by itself, without the need to keep templates in sync with the page protection: https://www.mediawiki.org/wiki/Manual:$wgEnableProtectionIndicators
If your templates are not too complex, it's possible you could enable that option on your wiki and replace the templates. The appearance of the indicators can be customized with some MediaWiki: messages and site CSS, per the docs on that page.
Among Wikimedia wikis, the option is currently only enabled on https://az.wikipedia.org/ (https://phabricator.wikimedia.org/T371440), so you can have a look at the protected pages there to see how it works in practice.
On Tue, 7 Oct 2025 at 15:07, Strainu strainu10@gmail.com wrote:
Hi all,
I'm trying to automate wrangling protection templates. Adding them is trivial, but I'm having issues with the removal. The best I have is go waaay back on protections, check the expiration date and see if the page is still protected. But that's both expensive and useless for long-term protections.
Is there any event/notification/anything at all available through the API that would allow me to know which pages' protection expired recently without keeping a list of protected pages?
Thanks, Strainu _______________________________________________ Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
Thank you all for your responses, as usual here I learned a lot! The tracking category seems to work just fine, so I'll stick to that for the moment.
wgEnableProtectionIndicators https://www.mediawiki.org/wiki/Manual:$wgEnableProtectionIndicators seems like a godsend for small wikis, as it looks very configure-and-forget to me. However, for Wikipedias that took their templates from enwiki it's probably too simple, since these versions sometime exapand into banners instead of locks, have reasons etc.
Have a good weeked folks! Strainu
În vin., 10 oct. 2025 la 20:34, Bartosz Dziewoński matma.rex@gmail.com a scris:
By the way, MediaWiki has recently gained the ability to display protection indicators by itself, without the need to keep templates in sync with the page protection: https://www.mediawiki.org/wiki/Manual:$wgEnableProtectionIndicators
If your templates are not too complex, it's possible you could enable that option on your wiki and replace the templates. The appearance of the indicators can be customized with some MediaWiki: messages and site CSS, per the docs on that page.
Among Wikimedia wikis, the option is currently only enabled on https://az.wikipedia.org/ (https://phabricator.wikimedia.org/T371440), so you can have a look at the protected pages there to see how it works in practice.
On Tue, 7 Oct 2025 at 15:07, Strainu strainu10@gmail.com wrote:
Hi all,
I'm trying to automate wrangling protection templates. Adding them is
trivial, but I'm having issues with the removal. The best I have is go waaay back on protections, check the expiration date and see if the page is still protected. But that's both expensive and useless for long-term protections.
Is there any event/notification/anything at all available through the
API that would allow me to know which pages' protection expired recently without keeping a list of protected pages?
Thanks, Strainu _______________________________________________ Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
-- Bartosz Dziewoński _______________________________________________ Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
wikitech-l@lists.wikimedia.org