You are currently viewing Change default “Posts” Label in WordPress to “Custom Text” using code snippets

Change default “Posts” Label in WordPress to “Custom Text” using code snippets

In this article I’ll explain how you can change default posts label in wordpress to custom text using code snippets.

It is also possible to change the default “Posts” label in WordPress to “Custom Text” using code snippets. Here is an example of a code snippet that you can add to your theme’s functions.php file:

change default posts label in wordpress to custom text using code snippets

function change_post_label() {
    global $menu;
    global $submenu;
    $menu[5][0] = 'Tattoos';
    $submenu['edit.php'][5][0] = 'Customs Text';
    $submenu['edit.php'][10][0] = 'Add Custom Text';
    $submenu['edit.php'][16][0] = 'Custom Text Tags';
}
add_action( 'admin_menu', 'change_post_label' );

This code will change the “Posts” label in the WordPress dashboard to “Customs Text” and also change the submenu labels accordingly.

Please note that this will only change the label in the admin area, it will not change the post URLs or the post type name.

Also be aware that if you change the post type name, it could break the existing URLs, so you might want to use a plugin like “Custom Post Type UI” or “Custom Post Type Permalinks” to change the post type name without breaking the existing URLs. If you’re facing any error with the above script then you can drop the error in the comment box or contact us directly.

Join Us on Facebook

Leave a Reply