MediaWiki: Search for page content directly in the database with SQL

To search text in the last revision of MediaWiki pages directly in the database with (My)SQL, use the following request:

select p.page_title FROM page p INNER JOIN revision ON page_latest = rev_id INNER JOIN text ON rev_text_id = old_id where old_text like '%text to search%';

This may be useful for instance to find pages which are using a deprecated plugin.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s