• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
  • VPS
    • VPS Hosting
    • Flex VPS
  • Reseller
  • Email
  • Gaming
  • Domains
  • Website Builder
  • Account
  • Blog Home
  • Categories
  • Authors

How To Hide The Byline In WordPress For All Themes

Bhagwad Park

Published on: October 15, 2018

Categories: WordPress 0

WordPress bylines are the little snippets of text that appear above each post. It’s usually different for each theme, and each site. Sometimes it includes the author name, sometimes, the last modified date, or published date. Whether or not it’s a good thing to include the byline is a subject of much debate. I think with the latest Google’s “medic” SEO update, it’s important to identify your authors to establish expertise, authority, and trust.

But if you want to get rid of the byline in WordPress, here’s how to do it.

Method 1 (Easy): Use CSS

Since each theme generates its byline differently, it’s easier to simply hide the byline with CSS. This has its own disadvantages as explained below, but here’s how to go about it.

First, we need to get the class of the byline used. To do this, right-click the byline and select “Inspect Element” in Google Chrome, or the equivalent menu item in other browsers. Now go line by line and find the highest element that contains the byline, and nothing else, like this:

Get the CSS Class

You can see here, that the class “post-meta” encloses the byline with the date. If I go any higher, it encompasses the title as well, and I don’t want to hide the title!

Now using the class information, I can easily construct a CSS rule to hide the byline like this:

.post-meta {
    display:none;
}

As you can see below, we can enter CSS into the theme customizer in WordPress and test out the results before applying the rules:

Hide the Byline in WordPress va CSS - Method 1

The byline has vanished. That was easy!

Disadvantages of Hiding the Byline via CSS

Remember that hiding something via CSS isn’t the same as removing it from the web page. Someone can still easily view the source page of the site and see what’s in there. So if your goal is to hide the author name from people as a security matter, this is a terrible solution.

To change the HTML itself, we’re going to have to modify the PHP code. Here’s how to do that.

Method 2 (Comprehensive): Change the Theme

The second method is the navigate to the theme files and make changes there directly. However, this isn’t as easy as it used to be. WordPress pages are no longer loaded from a single template like in the old days. These days, everything is mashed together from multiple sources. I’d written an earlier tutorial to show how to which template pages are used for any given WordPress post.

For our purposes however, we can make use of an even more direct method. First, download and install the plugin called “String Locator”. This will allow us to find out exactly which theme files we need to modify to remove the byline. For example, after installation, go to “Tools -> String Locator”, and type in the name of the byline class like this:

Find Location of the ByLine

On this page, you can see that the class “post-meta” is referenced in two different files. If you want to remove the post meta byline on single pages, then we need to modify “content-single.php”. Clicking the search result will take you directly to the place it’s mentioned.

Here, you can modify the PHP code to remove the byline entirely. Or you could write your own function. You can see that the byline is generated via the function “write_header_meta”. If you want, you can use the string locator plugin to find out where that function is defined, and then modify the function itself so that it returns something else.

How you want to go about it is up to you. I would just suggest that you use a child theme, and backup your files and database before you make any changes!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

How To Start A WordPress Blog (Five Easy Steps)

Starting a WordPress blog is easy, especially with NameHero. Llearn all the in's and out's with our guide.

WordPress Image Sizes: A Complete Guide

Check out our in-depth guide to WordPress image sizes. We'll also show you how to resize, compress, and optimize images in WordPress.

Drupal vs WordPress: 4 Key Differences

Drupal and WordPress are often grouped together as open source Content Management Systems (CMS). But in practice, WordPress and Drupal couldn’t be more different. Picking the wrong CMS for your project can make development a lot more troublesome. With the right approach, WordPress can be the backbone of almost any type of website. Drupal, on […]

Which Is The Best SEO Plugin For WordPress?

An important part of running a WordPress site is ensuring that it ranks in the search results. This means using an SEO plugin to optimize your pages with keywords and implement other strategies. But which is the best solution? Many popular SEO plugins provide on-page recommendations, XML sitemaps, and schema markup. However, you can also […]

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup (2024)

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Email Hosting
  • Game Hosting
  • Domains
  • Website Builder
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2025 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA