IT ENGLISH BOARD

How to Remove Author Name from WordPress Posts (2 Easy Ways)

WordPress
Author
inrokhah
Date
2019-05-29 22:57
Views
1720

Method 1: Manually Remove Author Name from WordPress Posts

Your WordPress theme decides when and how to display the author name in your blog posts. Themes use multiple approaches to do that which makes it harder for a plugin to provide a generic solution for removing author names.

You will need to edit some code to prevent your theme from displaying the author name. If you are uncomfortable editing code, then try the second method instead.

The first method requires you to edit WordPress theme files.

Note: Make sure that you create backup of your theme or child theme before making any changes. If something goes wrong, then this will help you easily revert changes.

WordPress themes use different variations of code to display the author name. You will need to locate the code responsible for showing the author’s name in your theme files and delete it.

Most common locations to find this code are single.php, content.php, archive.php, and index.php files.

In many cases, you will not be able to find the code that outputs author name. Instead, you will find a template tag defined in the functions.php file or template-tags.php file.

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


1

2

3

4

5

6

7

8

9

10

11

function twentynineteen_posted_by() {

        printf(

            /* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */

            '<span class="byline">%1$s<span class="screen-reader-text">%2$s</span><span class="author vcard"><a class="url fn n" href="%3$s">%4$s</a></span></span>',

            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 have located the code that outputs the author name, you need to delete it.

For example, you have to delete the code from the second line to the ninth line in the above code. After that, the remaining code will look like below.


1

2

3

function twentynineteen_posted_by() {

}

endif;



Don’t forget to save your changes after deleting the author name code. Then, upload the files back to your website.

You can now visit your website to see your changes in action:

Author Name Removed in WordPress Post Demo

This method hides the author name on all your posts; however, the author archive pages will remain intact. An author archive page is where WordPress creates a list of all articles written by a specific user.

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

https://example.com/author/samsmith/

This URL is discoverable by search engines, which means you may still get traffic to those pages.

You can disable the author archives easily using the Yoast SEO plugin. Once you install and activate the plugin, go to SEO » Search Appearance your dashboard and then click the ‘Archives’ tab.

Now you can see the author archive settings. You can toggle Author Archives switch and disable author archives on your site.

Yoast SEO Author Archive Settings

Doing so will disable author archives and hide author-sitemap.xml file created by the Yoast SEO plugin.
Total Reply 0

Total 104
Number Title Author Date Votes Views
103
Join a Microsoft Teams meeting
author | 2020.09.22 | Votes 0 | Views 2825
author 2020.09.22 0 2825
102
How to delete songs and albums from your Google Play Music library
author | 2020.09.19 | Votes 0 | Views 2996
author 2020.09.19 0 2996
101
Watch Prime Video on Chromecast
author | 2020.09.14 | Votes 0 | Views 2980
author 2020.09.14 0 2980
100
How to Fix the Win­dows 10 We Could­n’t Con­nect to the Update Ser­vice Issue (2)
author | 2020.09.09 | Votes 0 | Views 3734
author 2020.09.09 0 3734
99
IONOS Joomla! Standard Installation
author | 2020.09.02 | Votes 0 | Views 1798
author 2020.09.02 0 1798
98
How to improve the life of a Battery: (1)
author | 2020.08.25 | Votes 0 | Views 1825
author 2020.08.25 0 1825
97
Laptop battery not charging
author | 2020.08.21 | Votes 0 | Views 2142
author 2020.08.21 0 2142
96
Plugged in, not charging (1)
author | 2020.08.21 | Votes 0 | Views 1958
author 2020.08.21 0 1958
95
How to add reCaptcha plugin to a custom form on my WordPress website?
author | 2020.08.13 | Votes 0 | Views 2113
author 2020.08.13 0 2113
94
I can't log in to the WordPress admin dashboard after installing and activating Limit Attempts plugin
author | 2020.08.13 | Votes 0 | Views 1808
author 2020.08.13 0 1808
New