Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can get a list of pages last edited before (or after) a given date by running an SQL query like this:</p> <pre class="lang-sql prettyprint-override"><code>SELECT page_id, page_namespace, page_title FROM /*prefix*/page WHERE page_touched &lt; '20110101000000' </code></pre> <p>This lists the ID, namespace number and title of all pages that have not been edited since the beginning of 2011. (The timestamp format is <code>'YYYYMMDDHHMMSS'</code>.) If you configured a table name prefix when you installed MediaWiki, you need to replace <code>/*prefix*/</code> above with it.</p> <p>At this point, there are several things you could do:</p> <ul> <li><p>As Joshua C. Lerner suggests, you could <a href="http://meta.wikimedia.org/wiki/Help%3aExport" rel="nofollow">export</a> all the pages you want to keep (either with <a href="http://www.mediawiki.org/wiki/Manual%3aParameters_to_Special%3aExport" rel="nofollow">Special:Export</a> or with <code>maintenance/dumpBackup.php</code>) and re-import them into a new database.</p></li> <li><p>There's also a <a href="http://www.mediawiki.org/wiki/Manual%3aMaintenance_scripts" rel="nofollow">maintenance script</a> named <code>maintenance/deleteBatch.php</code> which can be used to delete a bunch of pages as if they'd been deleted in the usual way by an admin.</p></li> <li><p>Finally, if you're really sure you won't want the pages back, you could just replace the first line of the SQL query above with <code>DELETE</code>. I'd strongly suggest making a backup of your database before you do this. This will leave some orphaned revisions in the database, but you can get rid of them with the imaginatively named maintenance script <code>maintenance/deleteOrphanedRevisions.php</code>.</p></li> </ul> <p>(A minor issue with the first two methods above is that the export and batch delete scripts all want the pages listed with namespace <em>names</em>, while the SQL query returns namespace <em>numbers</em>. It's not that hard to convert one to the other just by search and replace, but it does add an extra step to the process. Of course, if all the pages you want to delete are in the main namespace, this is not an issue: just add <code>AND page_namespace = 0</code> to the query and drop the ID and namespace from the output.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload