Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

phpmyadmin, find all subdomain WordPress

  • SOLVED

first :
in phpmyadmin, I want to find all sites (in my multisite) which have a siteurl like http://xxxxxxx.example.com
xxxxxxx could be everything
= I want to find all the subdomain of example.com

second :
In php my admin, i want to remove all tables of all sites which are subdomains of example.com
so all sites which have an URL like that : http://xxxxxxx.example.com


Answers (4)

2013-11-30

Just Me answers:

Select * FROM wp_blogs WHERE domain LIKE '%example.com%';

2013-12-02

akhilesh singh answers:

you can use these queries in your phpmyadmin

follow these steps before run these queries
1. take *backup of your tables first before run these queries
2. replace " PREFIX_ " with your wp prifix


1-for search.

Select * FROM PREFIX_blogs WHERE domain LIKE '%example.com%';

2-for remove
DELETE FROM `PREFIX_blogs` WHERE domain LIKE '%example.com%'

2013-11-29

Francisco Javier Carazo Gil answers:

Sébastien use it http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ you can find and replace all subdomains to normal one.


Sébastien | French WordpressDesigner comments:

i don't need search and replace
1-I need search.
2-i need remove

2013-11-29

Fahad Murtaza answers:

first The table wp_blogs is the one.

You can do the SQL with %example.com%


Sébastien | French WordpressDesigner comments:

Ok but i have many many sites... so I need a request to display only the sites I want and a second request to remove all tables of this sites

with %example.com% I display the subdomains of example.com but I display too the sites which have example.com in its content.
I want just the subdomains.


Fahad Murtaza comments:

Well if you do the search just in wp_blogs folder and only search on the field 'domain'. That solves the first problem.


Sébastien | French WordpressDesigner comments:

i need a request