IT ENGLISH BOARD

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

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

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
23
WordPress. How to hide time and date from the post page
author | 2019.06.10 | Votes 0 | Views 2205
author 2019.06.10 0 2205
22
What’s The Difference Between JPG, PNG And GIF?
author | 2019.06.07 | Votes 0 | Views 2146
author 2019.06.07 0 2146
21
How to Migrate your Site with All-in-One WP Migration
author | 2019.06.07 | Votes 0 | Views 2472
author 2019.06.07 0 2472
20
How do I Stop My Android Tablet from Sleeping?
author | 2019.06.04 | Votes 0 | Views 2148
author 2019.06.04 0 2148
19
How to keep your Android phone's screen on longer
author | 2019.06.04 | Votes 0 | Views 2557
author 2019.06.04 0 2557
18
Things You MUST DO Before Changing WordPress Themes (1)
inrokhah | 2019.05.29 | Votes 0 | Views 2379
inrokhah 2019.05.29 0 2379
17
How to Remove Author Name from WordPress Posts (2 Easy Ways)
inrokhah | 2019.05.29 | Votes 0 | Views 2143
inrokhah 2019.05.29 0 2143
Re:How to Remove Author Name from WordPress Posts (2 Easy Ways)
inrokhah | 2019.05.29 | Votes 0 | Views 2145
inrokhah 2019.05.29 0 2145
16
Remove sidebar / widgets from WooCommerce shop page (13)
inrokhah | 2019.05.26 | Votes 0 | Views 2284
inrokhah 2019.05.26 0 2284
15
Online documentation: Buttons Shortcode and Widget plugin
inrokhah | 2019.05.26 | Votes 0 | Views 2502
inrokhah 2019.05.26 0 2502
14
Buttons Shortcode and Widget
inrokhah | 2019.05.26 | Votes 0 | Views 2614
inrokhah 2019.05.26 0 2614
New