{"id":75500,"date":"2012-04-03T11:00:16","date_gmt":"2012-04-03T15:00:16","guid":{"rendered":"http:\/\/wpmu.org\/?p=75500"},"modified":"2012-04-02T19:31:59","modified_gmt":"2012-04-02T23:31:59","slug":"how-to-change-the-titles-of-your-wordpress-category-and-tag-meta-boxes","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/how-to-change-the-titles-of-your-wordpress-category-and-tag-meta-boxes\/","title":{"rendered":"How to Change the Titles of Your WordPress Category and Tag Meta Boxes"},"content":{"rendered":"<p>We all know what the category and tag meta boxes look like on the write\/edit page in WordPress.<\/p>\n<p><a rel=\"lightbox[75500]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/how-to-change-the-titles-of-your-wordpress-category-and-tag-meta-boxes\/normal-categories-and-tags-metaboxes\/\" rel=\"attachment wp-att-75503\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75503\" title=\"normal-categories-and-tags-metaboxes\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/04\/normal-categories-and-tags-metaboxes.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"642\" height=\"626\" \/><\/a>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\u2019t even realize they\u2019re using a \u201cblogging\u201d platform.<\/p>\n<p>In this example, I\u2019m going to change the name of my Categories meta box to \u201cCountry,\u201d and I\u2019m going to change the name of my Tags meta box to \u201cCity.\u201d<\/p>\n<p>In my functions.php file (Appearance &gt; Editor &gt; Theme Functions \u2013 functions.php), I\u2019ve placed the following code:<\/p>\n<p><code>add_action( 'add_meta_boxes', 'change_tag_meta_box', 0 );<br \/>\nfunction change_tag_meta_box() {<br \/>\nglobal $wp_meta_boxes;<br \/>\nunset( $wp_meta_boxes['post']['side']['core']['tagsdiv-post_tag'] );<br \/>\nadd_meta_box('tagsdiv-post_tag',<br \/>\n__('City'),<br \/>\n'post_tags_meta_box',<br \/>\n'post',<br \/>\n'side',<br \/>\n'low');<br \/>\n}<\/code><\/p>\n<p><code>add_action( 'add_meta_boxes', 'change_cat_meta_box', 0 );<br \/>\nfunction change_cat_meta_box() {<br \/>\nglobal $wp_meta_boxes;<br \/>\nunset( $wp_meta_boxes['post']['side']['core']['categorydiv'] );<br \/>\nadd_meta_box('categorydiv',<br \/>\n__('Country'),<br \/>\n'post_categories_meta_box',<br \/>\n'post',<br \/>\n'side',<br \/>\n'low');<br \/>\n}<\/code><\/p>\n<p>And here\u2019s the result.<\/p>\n<p><a rel=\"lightbox[75500]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/how-to-change-the-titles-of-your-wordpress-category-and-tag-meta-boxes\/changed-meta-boxes\/\" rel=\"attachment wp-att-75506\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75506\" title=\"changed-meta-boxes\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/04\/changed-meta-boxes.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"642\" height=\"626\" \/><\/a><\/p>\n<p>If you would like to change your own Categories and Tags meta boxes, then you can use the code above and simply replace \u201cCity\u201d and \u201cCountry\u201d with whatever names you\u2019d like.<\/p>\n<h2><strong>Change Other Meta Boxes<\/strong><\/h2>\n<p>If you would like to change other meta boxes, then we\u2019ll go through the code so you can figure out what you\u2019d like to change for yourself. We will\u00a0 change the Excerpts meta box in this example to read \u201cPost Description.\u201d<\/p>\n<p>Let&#8217;s take a look at the &#8220;tags&#8221; portion of the code from above. The different highlighted sections are what you will need to change.<\/p>\n<p><code>add_action( 'add_meta_boxes', '<span style=\"color: #ff0000;\"><strong>change_tag_meta_box<\/strong><\/span>', 0 );<br \/>\nfunction <span style=\"color: #ff0000;\"><strong>change_tag_meta_box<\/strong><\/span>() {<br \/>\nglobal $wp_meta_boxes;<br \/>\nunset( $wp_meta_boxes['post']['side']['core']['<span style=\"color: #0000ff;\"><strong>tagsdiv-post_tag<\/strong><\/span>'] );<br \/>\nadd_meta_box('<span style=\"color: #0000ff;\"><strong>tagsdiv-post_tag<\/strong><\/span>',<br \/>\n__(<strong>'<span style=\"color: #008000;\">City<\/span>'<\/strong>),<br \/>\n'<span style=\"color: #800080;\"><strong>post_tags_meta_box<\/strong><\/span>',<br \/>\n'post',<br \/>\n'side',<br \/>\n'low');<br \/>\n}<\/code><\/p>\n<p>There are six different pieces of text you will need to change in the code above to change a new meta box.<\/p>\n<p>The first in the example above is<\/p>\n<pre>'<strong>change_tag_meta_box<\/strong>'<\/pre>\n<p>This is a unique name that you make yourself. We\u2019ll change ours to be about the excerpt:<\/p>\n<pre>'change_excerpt_meta_box'<\/pre>\n<p>You will need to put this in two places.<\/p>\n<p>The next portion to change from the code above is the following parameter:<\/p>\n<pre>'<strong>tagsdiv-post_tag<\/strong>'<\/pre>\n<p>Looking on <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/remove_meta_box\" target=\"_blank\">this WordPress Codex page<\/a>, we find that the parameter we want is the following:<\/p>\n<pre>'postexcerpt'<\/pre>\n<p>You will need to put this in two places as well.<\/p>\n<p>The next piece is the new name you want:<\/p>\n<pre><strong>'City'<\/strong><\/pre>\n<p>In our case, we\u2019re going to change that to<\/p>\n<pre>'Post Description'<\/pre>\n<p>The last piece is the name of the function:<\/p>\n<pre>'<strong>post_tags_meta_box<\/strong>'<\/pre>\n<p>You can <a href=\"http:\/\/phpxref.ftwr.co.uk\/wordpress\/nav.html?_functions\/index.html\" target=\"_blank\">search this page<\/a> to find the function you\u2019re after. In our case, it\u2019s the following:<\/p>\n<pre>'post_excerpt_meta_box'<\/pre>\n<p>And so when we substitute in all our different pieces of code, it looks like this.<\/p>\n<p><code>add_action( 'add_meta_boxes', 'change_excerpt_meta_box', 0 );<br \/>\nfunction change_excerpt_meta_box() {<br \/>\nglobal $wp_meta_boxes;<br \/>\nunset( $wp_meta_boxes['post']['side']['core']['postexcerpt'] );<br \/>\nadd_meta_box('postexcerpt',<br \/>\n__('Post Description'),<br \/>\n'post_excerpt_meta_box',<br \/>\n'post',<br \/>\n'side',<br \/>\n'low');<br \/>\n}<\/code><\/p>\n<p>And here\u2019s the result.<\/p>\n<p><a rel=\"lightbox[75500]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/how-to-change-the-titles-of-your-wordpress-category-and-tag-meta-boxes\/post-description\/\" rel=\"attachment wp-att-75507\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75507\" title=\"post-description\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/04\/post-description.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"640\" height=\"406\" \/><\/a><\/p>\n<h2><strong>References<\/strong><\/h2>\n<p>Again, the following two pages will help you to identify what to change:<\/p>\n<p>Look in the Paramaters ($id) section on this <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/remove_meta_box\" target=\"_blank\">WordPress Codex page<\/a>.<\/p>\n<p><a href=\"http:\/\/phpxref.ftwr.co.uk\/wordpress\/nav.html?_functions\/index.html\" target=\"_blank\">This page<\/a> has a list of different meta box functions.<\/p>\n<h2><strong>Make Your Own Plugin<\/strong><\/h2>\n<p>If you would like to turn this code into a simple plugin for your own use, then <a href=\"https:\/\/wpmudev.com\/blog\/wordpress-plugin-development-guide\/\" target=\"_blank\">see this post for instructions<\/a>.<\/p>\n<p>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\u2019s a concern, then you will want to look for a plugin that allows you to change you\u2019re the names of your admin menu items.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Change the name of any meta box on your write\/edit screen.<\/p>\n","protected":false},"author":84404,"featured_media":205603,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[235],"tags":[152],"tutorials_categories":[],"class_list":["post-75500","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-misc","tag-categories"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/75500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/84404"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=75500"}],"version-history":[{"count":3,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/75500\/revisions"}],"predecessor-version":[{"id":198471,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/75500\/revisions\/198471"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/205603"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=75500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=75500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=75500"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=75500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}