Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Add the Theme Editor in WordPress Admin Bar

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Add the Theme Editor in WordPress Admin Bar

In the past we have shown you how to add the shortlink menu, draft posts, and other things to the WordPress admin bar. In this article, we will show you how to add the Theme Editor in WordPress Admin Bar.

All you need to do is either open your site-specific plugin or your theme’s functions.php file and paste the following code:

// Add Theme Editor to Admin Bar (to save time!)
function admin_bar_theme_editor_option() {  
	global $wp_admin_bar;   
		if ( !is_super_admin() || !is_admin_bar_showing() )      
			array( 'id' => 'edit-theme',            
			'title' => __('Edit Theme'),
                        'href' => admin_url( 'theme-editor.php')       

add_action( 'admin_bar_menu', 'admin_bar_theme_editor_option', 100 );

That is it. We found this code floating around on the WordCamp Nashville Hashtag. We tried it on WordPress 3.3.2 and it works. The code should work for other versions as well.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. something4ken says:

    Very helpful. It saves me about 2 clicks.

  2. Zach says:

    I think it’d be better to use admin_url() instead of get_blogoinfo() in this case:

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.