WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a local multisite installation I use for development with a relatively large number of sites set up. Every site has its own numbered database tables (i.e. wp_n_links, wp_n_options, wp_n_postmeta etc.)

Every time I need to look at a database table in phpMyAdmin I have to look through all the wp_n_options tables to find the tables for the site I need and with a lot of sites this can get a bit tedious!

Is there a better way to find out which tables belong to which site?

share|improve this question
    
How are you looking at database tables, in PHPMyAdmin? – birgire Feb 23 at 12:38
    
Sorry, should have mentioned that, yes in phpMyAdmin. – Cai Feb 23 at 12:40
    
are you looking for a way to find the blog_id for a given site (like tsipilai shows) or are you looking for a way to display all tables related to a given table prefix (my understanding)? – birgire Feb 23 at 14:26
    
Well, now i realise I'm looking for the blog_id for a given site. I didn't realise the number in the table name corresponded to the blog_id.. I feel a bit stupid now. – Cai Feb 23 at 14:31
    
no problem, please don't feel that. I just thought you're looking for some general search tools within PHPMyAdmin ;-) – birgire Feb 23 at 14:42
up vote 6 down vote accepted

The number you refer to is the blog/site ID, so you have multiple methods of finding out which site it is:

  • Look in the sites table, the number should match the ID, providing you with a URL and title
  • Go to example.com/wp-admin/network/site-info.php?id=insert-number-here and you'll be shown the network admin UI for that site
  • Consider a plugin or custom column in the sites area of the network admin that displays the blog ID
share|improve this answer

Look the wp_blogs table, theres "blog_id" and "path" to identify that. Does it help?

share|improve this answer
    
That actually does help! I didn't realise the blog_id corresponded to the numbers in the table names. – Cai Feb 23 at 14:32
    
+1, but the one thing to be aware of is that AFAIK the domain mapping plugins use their own setting area so if you use them this might not give you the mapped domain. – Mark Kaplun Feb 23 at 14:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.