Just recently I ran into a case where I had to quickly look something up in the database of my WordPress development environment. I typically do this via a program called Sequel Pro, which helps give some visualization to your database. I love Command Line tools, but sometimes I prefer the visuals to do some troubleshooting.

If you’ve ever looked at a WordPress database, you’ll typically see tables like wp_posts, wp_postameta, and wp_options. In multisite however, things like the posts table, postmeta and options are in tables that contain the blog_id, giving us wp_3_posts, wp_3_postmeta, and wp_3_options. No problem at all if your multisite only has a couple sites setup, but when you use it for your development environment, you get something like this:

Screen Shot 2015-02-20 at 11.32.51 AM

Determining what blog ID you are looking at, isn’t quite easy. So here’s a quick snippet that will drop the current blog ID in the admin header, like so:

Screen Shot 2015-02-20 at 11.35.06 AM

function kfg_toolbar_blog_id( $wp_admin_bar ) {
	$args = array(
		'id'    => 'blog_id',
		'title' => 'Blog #' . get_current_blog_id()
	);
	$wp_admin_bar->add_node( $args );
}
add_action( 'admin_bar_menu', 'kfg_toolbar_blog_id', 999 );

Posted by Chris Klosowski

Chris Klosowski is the Director of Technology at Sandhills Development, LLC, creators of fine WordPress plugins, and ecommerce solutions.

52 Comments

  1. […] In addition to all the default items that show up in a Network Install I’ve got items added by Query Monitor, Airplane Mode, Debug Bar, Plugin Toggle, and my own Blog ID item. […]

    Reply

  2. We’re a group of volunteers and opening a new scheme in our community.
    Your site provided us with valuable info to work
    on. You’ve done an impressive job and our entire community will be thankful to you.

    Reply

  3. viagra,cialis india what is better viagra or cialis or levitra?? – viagra blindness 2010

    Reply

  4. viagra samsclub when was viagra invented – viagra time to work

    Reply

  5. buy prednisone 5mg canada prednisone online – prednisone where can i buy

    Reply

  6. zithromax online pharmacy canada zithromax for sale – zithromax online pharmacy canada

    Reply

  7. 20mg prednisone buy prednisone – prednisone 2.5 tablet

    Reply

  8. ivermectin cream cost stromectol for sale – ivermectin lotion price

    Reply

  9. ivermectin over the counter stromectol tablets – stromectol

    Reply

  10. buy cheap prescription drugs online ed meds online without doctor prescription – errectile disfunction

    Reply

  11. ed pills otc prescription drugs online without doctor – natural herbs for ed

    Reply

  12. errectile dysfunction ed meds online without prescription or membership – pain meds online without doctor prescription

    Reply

  13. how much is plaquenil pill plaquenil for sale canada – generic for hydroxychloroquine 200 mg

    Reply

  14. lipitor 5mg coupon for lipitor – lipitor online pharmacy

    Reply

  15. stromectol online buy stromectol – buy ivermectin for humans uk

    Reply

  16. plaquenil drug hydroxychloroquine – hydroxychloroquine-o-sulfate

    Reply

  17. cialis for sell real cialis on line ordering – generic cialis testimonials

    Reply

  18. cost of viagra viagra pills – viagra 100mg price

    Reply

  19. cialis pills australia cialis no prescription canada – no prescription generic cialis

    Reply

  20. clomid purchase buy clomid – clomid alcohol

    Reply

  21. ed pumps ed meds pills drugs – ed clinics

    Reply

  22. Hello, i think that i saw you visited my site so i
    came to “return the favor”.I am attempting to find things to enhance my site!I suppose its ok to use some of your ideas!!

    Reply

  23. muse ed drug ed meds pills drugs – prescription drugs without doctor approval

    Reply

  24. ivermectin pills ivermectin for sale – ivermectin 2%

    Reply

  25. My coder is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the expenses.

    But he’s tryiong none the less. I’ve been using Movable-type on a number of websites
    for about a year and am nervous about switching to another platform.

    I have heard fantastic things about blogengine.net.

    Is there a way I can import all my wordpress content into it?
    Any kind of help would be greatly appreciated!

    Reply

  26. generic prednisone 10mg cheap prednisone – prednisone pills for sale

    Reply

  27. I’m impressed, I must say. Rarely do I come across a blog that’s
    both educative and amusing, and without a doubt, you’ve hit the nail on the head.
    The issue is something that not enough men and women are speaking
    intelligently about. Now i’m very happy I came across this during
    my hunt for something relating to this.

    Reply

  28. ivermectin for sale ivermectin for humans – ivermectin 9 mg

    Reply

  29. http://buypropeciaon.com/ – propecia results after 3 months

    Reply

  30. propecia 1mg buy propecia finasteride – propecia online pharmacy

    Reply

  31. finasteride 1 mg merck propecia – can you get propecia without a prescription

    Reply

  32. What’s up it’s me, I am also visiting this web site daily, this website
    is genuinely good and the visitors are actually sharing good thoughts.

    Reply

  33. finasteride 1mg propecia generic – finasteride

    Reply

  34. propecia pill propecia generic – finasteride medication

    Reply

  35. Appreciate this post. Will try it out.

    Reply

  36. aspirin and ed canadian pharmacies that ship to us – prescription meds without the prescriptions

    Reply

  37. best ed drug canadian approved online pharmacies – natural ed remedies

    Reply

  38. viagra price best place to buy generic viagra online – online doctor prescription for viagra

    Reply

  39. where to buy viagra online viagra over the counter – over the counter viagra

    Reply

  40. natural treatments for ed best canadian mail order pharmacies – best ed solution

    Reply

  41. buy cialis free shipping cialis online overnight shipping – when cialis patent expires

    Reply

  42. ivermectin usa ivermectin – cost of ivermectin medicine

    Reply

  43. ivermectin 3 mg tabs ivermectin for humans – ivermectin iv

    Reply

  44. ivermectin ebay buy ivermectin online – ivermectin ebay

    Reply

  45. ed for men canada ed drugs – ed meds

    Reply

  46. fast ed meds online legal to buy prescription drugs from canada – comfortis without vet prescription

    Reply

Leave a reply

Your email address will not be published. Required fields are marked *