Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Certes
.
This query lists template uses such as {{Portal|Foo}} or {{Portal|History|Foo|Science}} where Foo is not a portal nor a redirect to one. If multiple portals are listed for one article, they usually appear in the same template call. There will be some false positives, where an article has no such template but links to a portal in another way. However, no actual portals are listed. Most should be removed but some can usefully be replaced by similar portals which do exist. For example, {{Portal|Judaïsme}} obviously attempts to link the actual [[Portal:Judaism]].
Toggle Highlighting
SQL
SET STATEMENT max_statement_time=100 FOR SELECT Pa.page_title AS article, pl_title AS portal, Ps.page_title AS suggestion FROM pagelinks JOIN page Pa ON Pa.page_id=pl_from AND Pa.page_namespace = 0 AND Pa.page_title NOT LIKE "Portal/%" JOIN templatelinks ON tl_from=pl_from AND tl_title LIKE "Portal%" LEFT JOIN page Ps ON Ps.page_title LIKE CONCAT(SUBSTR(pl_title,1,3),"%") AND UPPER(Ps.page_title) = UPPER(pl_title) WHERE pl_namespace=100 AND pl_title NOT LIKE "%/%" AND NOT EXISTS (SELECT 1 FROM page WHERE page_title=pl_title AND page_namespace=100) ORDER BY page_title, pl_title
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...