Null edit

From Support Wiki
Jump to navigation Jump to search

A null edit, also known as a blank edit, refers to the process of editing a page and then saving it without any changes; or simulating this action using some tool that sends an empty edit via the MediaWiki API.

When & why should you null edit a page?

Typically, the reason to null edit a page is to transfer a template change into stored data from the page you are null editing. For example:

  • A page called Bastet is storing data to a Cargo table Gods via the template God infobox. Right now, there's a typo in our Cargo store, where we're storing |location= on accident. Whoops! We fix that, but nothing happens yet because updates to transcluded templates don't trigger updates to stored data. To fix this, we blank edit Bastet's page, and now the table displays a location of Egypt. Yay!
  • The job queue is super stuck and our rebuild isn't going through. So we blank edit every page storing data to our table. All better!
  • We have a somewhat complicated setup where some data is read from Lua to our page (still Bastet), and then it's stored in Cargo after that. We decide we're now going to include half-siblings in the siblings list-type field. So we update our Lua data to include siblings = ["Horus", "Anhur"] and then we're done, right? Wrong! Even if Bastet's page will display the correct information after waiting a bit for a cache update (or forcing it with a purge), we still need to force a stored-data update, which we do by blank editing. Yay!

How to blank edit?

There are several options.

  • The easiest method for a single page is to press edit (or alt+shift+e) and then save (or alt+shift+s).
  • You can also use the null edit gadget on your wiki (you need to be an admin to install it, or ask your admin to install it for you, and then anyone can use it).
  • In AutoWikiBrowser, you can:
    1. Go to Options and uncheck "Apply changes automatically." This makes the bot erase all the changes it tries to make before saving, and saves the page anyway.
    2. Make a list of pages, most likely via Source: What transcludes page (all Namespaces).
    3. Create some rule that would make changes if you had "Apply changes automatically" checked.
      • For example, you can go to "More...", "Categories" and add a category.
      • This ensures the bot doesn't short-circuit and skip the page entirely, but instead attempts to make a change, runs into "Apply changes automatically" being unchecked, undoes its changes, and then send an empty save request.
    4. In the "Bots" tab, check "Auto save", or else you'll need to save pages manually.
    5. In the "Start" tab, press Start and you're done!
  • In PyWikiBot, you can run something like python3 touch -transcludes:"Template:MyTemplate". You may want to use a different generator from transcludes, and you may also want to specify a family.
  • If you are comfortable writing your own Python scripts & would rather write your own tool than use an existing third-party one, check out mwcleric or mwclient on PyPI.

Confirming your blank edit worked

Blank edits won't show up in Special:RecentChanges or page history, so there is no direct way to tell if your blank edit did anything. However, you are probably blank editing for a reason, so you can check if your action worked, for example:

  • If you are updating Cargo data, check if the page values have updated (see the page values link in the sidebar)
  • If you are updating categories, go to those category pages and check if your page is listed there now
  • If you are updating backlinks, go to Special:WhatLinksHere for a page you link to or a template you transclude, and check if your page shows up there now
  • Try querying the page's information (action=query) in the API Sandbox and see if it's correct

See also