WordPress

How to Remove Author Name from WordPress Posts

How-to-Remove-Author-Name-from-WordPress-Posts

Do you really want to remove author name from WordPress blog post?

Some of the blog owners don’t like to display the author name in their blog post. As we know that by default WordPress doesn’t have any option to remove author name.

In this tutorial, we will show you how to remove the author name from your WordPress posts.

Author name is one of the important types of metadata that is added to your WordPress posts by default. It allows your readers to see author profile who create the content on your blog.

Manually Removing Author Name from WordPress Posts

You have to add code to prevent your theme from displaying the author name. The first step requires you to edit your WordPress theme files.

WordPress themes use different variations of code in displaying the author name. You will need to find the code that is responsible for showing the author’s name in your theme files and remove it. The most common location to find the code is single.php, archive .php, content.php, and index.php files.

In several cases you have to find the code that displays author name. Instead, you will find a template tag defined in the functions.php file.

Just take an example of Twenty Nineteen theme, the default Twenty Nineteen theme uses the function twentynineteen_posted_by to display the author name. This function is defined in template-tags.php file and uses the following code:

function twentynineteen_posted_by() {
printf(
/* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
'',
twentynineteen_get_icon_svg( 'person', 16 ),
__( 'Posted by', 'twentynineteen' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
);
}
endif;

Once you finded the code that displays the author name, you need to delete it.

You have to delete the above code. After that, the remaining code will look like below.

function twentynineteen_posted_by() {
}
endif;

After that save your changes. Then, upload the files back to your website. You can now see your website to make sure that your changes in action:

Author Name remove in post

This method only hides the author name on all of your posts. You have to hide from archive page as well where WordPress creates a list of all articles written by a specific author.

You can find author archive page on a URL like this:

https://example.com/author/amanda/

This URL is indexable by search engines that mean you still get traffic to these pages.
You can now easily disable the author archives using the Yoast SEO plugin.
Go to SEO -> Search Appearance and then click on the Archives tab. Disable the author archives on your site.

Yoast SEO Author Archive disabled

We hope this tutorial helped you learn how to remove author name from WordPress posts.

 

Related posts

20 Best Membership Plugins for WordPress in 2019

WPiTech

How to Protect Your WordPress Site from Rest API Attacks

WPiTech

7 Best WordPress Hosting Providers

WPiTech

Leave a Comment