How to Change the Titles of Your WordPress Category and Tag Meta Boxes

How to Change the Titles of Your WordPress Category and Tag Meta Boxes

We all know what the category and tag meta boxes look like on the write/edit page in WordPress.

But as many of us look to use WordPress as a general content management system (CMS) and not just a blogging tool, it may help to change the labels on certain things, especially if you are building for clients or site users who don’t even realize they’re using a “blogging” platform.

In this example, I’m going to change the name of my Categories meta box to “Country,” and I’m going to change the name of my Tags meta box to “City.”

In my functions.php file (Appearance > Editor > Theme Functions – functions.php), I’ve placed the following code:

add_action( 'add_meta_boxes', 'change_tag_meta_box', 0 );
function change_tag_meta_box() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['post']['side']['core']['tagsdiv-post_tag'] );
add_meta_box('tagsdiv-post_tag',
__('City'),
'post_tags_meta_box',
'post',
'side',
'low');
}

add_action( 'add_meta_boxes', 'change_cat_meta_box', 0 );
function change_cat_meta_box() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['post']['side']['core']['categorydiv'] );
add_meta_box('categorydiv',
__('Country'),
'post_categories_meta_box',
'post',
'side',
'low');
}

And here’s the result.

If you would like to change your own Categories and Tags meta boxes, then you can use the code above and simply replace “City” and “Country” with whatever names you’d like.

Change Other Meta Boxes

If you would like to change other meta boxes, then we’ll go through the code so you can figure out what you’d like to change for yourself. We will  change the Excerpts meta box in this example to read “Post Description.”

Let’s take a look at the “tags” portion of the code from above. The different highlighted sections are what you will need to change.

add_action( 'add_meta_boxes', 'change_tag_meta_box', 0 );
function change_tag_meta_box() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['post']['side']['core']['tagsdiv-post_tag'] );
add_meta_box('tagsdiv-post_tag',
__('City'),
'post_tags_meta_box',
'post',
'side',
'low');
}

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

There are six different pieces of text you will need to change in the code above to change a new meta box.

The first in the example above is

'change_tag_meta_box'

This is a unique name that you make yourself. We’ll change ours to be about the excerpt:

'change_excerpt_meta_box'

You will need to put this in two places.

The next portion to change from the code above is the following parameter:

'tagsdiv-post_tag'

Looking on this WordPress Codex page, we find that the parameter we want is the following:

'postexcerpt'

You will need to put this in two places as well.

The next piece is the new name you want:

'City'

In our case, we’re going to change that to

'Post Description'

The last piece is the name of the function:

'post_tags_meta_box'

You can search this page to find the function you’re after. In our case, it’s the following:

'post_excerpt_meta_box'

And so when we substitute in all our different pieces of code, it looks like this.

add_action( 'add_meta_boxes', 'change_excerpt_meta_box', 0 );
function change_excerpt_meta_box() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['post']['side']['core']['postexcerpt'] );
add_meta_box('postexcerpt',
__('Post Description'),
'post_excerpt_meta_box',
'post',
'side',
'low');
}

And here’s the result.

References

Again, the following two pages will help you to identify what to change:

Look in the Paramaters ($id) section on this WordPress Codex page.

This page has a list of different meta box functions.

Make Your Own Plugin

If you would like to turn this code into a simple plugin for your own use, then see this post for instructions.

Note: This only changes the name of your meta boxes on your write/edit screen. It does not change the name of your admin menu items. If that’s a concern, then you will want to look for a plugin that allows you to change you’re the names of your admin menu items.

Tags: