Do you want to remove the default author profile fields in WordPress?
If you run a WordPress blog with multiple authors, you might want to display all author profiles the same way. Removing default author profile fields in WordPress helps control what information your authors can include in their name or biography.
In this article, we will show you how to remove default author profile fields in WordPress.
Why Remove Default Author Profile Fields?
When you create a new user on your WordPress website, you need to fill out default fields like First Name, Last Name, Display name publicly as, Contact Info (email and website), Biographical Info, and Profile Picture. These fields are the same whether you have a blog, WooCommerce store, or other WordPress site.
Some user roles, like Author, can edit these fields. This is useful if they need to update their public profile. However, there are times when you might want to remove these default fields to keep a consistent brand identity, especially if articles are published under the company’s name. Simplifying the author profile editing interface also makes it quicker and easier to add new authors, focusing only on essential information.
Now, let’s see how you can remove these default author profile fields in WordPress.
Removing Default Author Profile Fields With WPCode
To remove default author profile fields, we have some simple code snippets you can add to your functions.php file. Normally, you would manually edit your theme file, but this is not always safe and can cause errors.
Instead, we will use WPCode, a plugin that makes it easy to insert code into WordPress without directly working with theme files. This reduces the chance of breaking your website.
We will use the free version of WPCode, but the Pro version offers more advanced features like testing mode and conditional logic.
First, install the WPCode plugin from your WordPress dashboard. After activating the plugin, go to Code Snippets » + Add Snippet. Then, select ‘Add Your Custom Code (New Snippet)’ and click the ‘Use snippet’ button.
Name your new snippet something simple like ‘Removing Edit User Fields for Author’ and set the Code Type to ‘PHP Snippet.’
In the Code Preview box, copy and paste the following code:
add_action('admin_footer-profile.php', 'remove_profile_fields');
function remove_profile_fields() {
if(is_admin() && current_user_can('author')) { // Check if the current user has the 'Author' role
<script type="text/javascript">
jQuery(document).ready(function($) {
// Remove the sections titled "Name", "Contact Info", and "About Yourself"
$('h2:contains("Name"), h2:contains("Contact Info"), h2:contains("About Yourself")').each(function() {
// Remove the next form-table and the h2 itself
$(this).next('.form-table').remove();
$(this).remove();
});
});
</script>
}
}
This code uses the admin_footer-profile.php
action hook to inject custom JavaScript into the admin footer of the profile editing page. This ensures the script runs after the page has fully loaded. It checks if the current user has the “Author” role using current_user_can('author')
. If true, the code injects JavaScript that uses jQuery to find the <h2> elements containing the text “Name”, “Contact Info”, and “About Yourself,” and removes the corresponding form fields and headers.
Once you have pasted the code, set the Insert Method to ‘Auto Insert’ and the Location to ‘Run Everywhere.’ Then, click the Inactive toggle at the top to change it to Active, and click the ‘Save Snippet’ button.
To check if it works, log in to your WordPress admin area as an Author and go to Profile. If you only see the Personal Options, Account Management, and Application Passwords settings, then the code is working.