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
SELECT page_title AS article, pl_title AS portal FROM pagelinks JOIN page ON page_id=pl_from AND page_namespace = 0 WHERE pl_namespace=100 AND pl_title NOT LIKE "%/%" AND pl_title NOT LIKE "%_(state)" /* Top level portal */ AND NOT EXISTS (SELECT 1 FROM page WHERE page_title=pl_title AND page_namespace=100) /* Portal is a redlink */ AND EXISTS (SELECT 1 FROM templatelinks WHERE tl_from=pl_from AND tl_target_id IN (SELECT lt_id FROM linktarget WHERE lt_title LIKE "Portal%")) /* Article uses {{Portal...}} */ ORDER BY article, portal
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...