Sélectionner une page

How to Remove Author and Date Information from Your WordPress Posts

How to Remove Author and Date Information from Your WordPress Posts


By default, most WordPress themes display a set of meta data on published blog posts. Most of the time, author and date are prominent, and categories and tags show up pretty often, too. This info can certainly be useful, but there are certain instances where you might want to remove author and date. (For example, older ‘evergreen’ posts can benefit from having the published date removed, so as not to imply the content is dated.)

You can do this in three ways: manually (with PHP or CSS), using a plugin, or using a Divi Blog module.

Subscribe To Our Youtube Channel

How to Remove Author and Date Information Manually

If you’re comfortable adding or editing code, you can remove author and date information manually using PHP. And if you’re comfortable copy/pasting code, you can do it with CSS.

Before we dive in, it’s important to note that prior to making these changes, you should back up your theme’s files just in case. We recommend using a plugin such as UpdraftPlus.

1. Add Some Custom CSS

From your main WP dashboard, go into Appearance – Customize, and at they very bottom, you will see an option called Additional CSS.

How to Remove Author and Date from WordPress posts

When you click in, you can add this snippet into the code box. (You can also add this CSS to the Divi theme options under Divi – Theme – General – Custom CSS.)

/* Remove meta data */
.entry-meta .byline, .entry-meta .cat-links { display: none; }

.entry-meta .posted-on { display: none; }

(Code snippet source: Design Wall)

Additionally, you can go to Appearance – Editor to edit the stylesheet directly. You will see a screen like this:

How to Remove Author and Date from WordPress posts

Finally, hit Save Stylesheet and you’re done. The author and date should no longer be visible on any posts.

2. Delete the PHP Code From Your Theme’s Files

A more permanent solution is simply removing the meta data code from your theme entirely.. When making edits directly to your theme files, we highly recommend using a child theme and backing up your site prior to making changes. Every theme handles this a little differently, however, so you may have to contact your theme author to find out which files hold the meta data you want to remove.

Once you know which files you need to edit, you can use an FTP client to delete the relevant lines of code. If you don’t already have one, we recommend FileZilla, which is free and easy to use. WP File Manager is also an in-dashboard tool you can use which works great.

Once you’re logged in, find the file(s) that you need to edit. Make sure you download a copy first, just in case things go awry. Once that’s taken care of, you will want to open up the file in the editor. Usually there’s a right-click option to view/edit or edit.

For the Extra theme, for instance, if you want to remove the meta data from posts, you can go into single-post.php and remove this snippet.

How to Remove Author and Date from WordPress posts

If you want more info on the specific meta data tags to remove author and date from WordPress posts, you can hop over to the Codex and read about the individual items theme authors may include.

How to Remove Author and Date from WordPress posts

How to Remove Author and Date Information Using a Plugin

How to Remove Author and Date from WordPress posts

If you don’t want to mess with any code at all, that’s fine and dandy. You can use the WP Meta and Date Remover plugin to remove the author and date information from all of your posts in one go.

Once the plugin is activated, all of the meta information is automatically removed. It uses two methods to remove the data: hiding it from the front end via CSS, and removing it from the back end via PHP. The latter method means that the meta data is also no longer visible to search engines, and you have the option to use just one method or both.

Key features:

  • Easy to install and setup.
  • Hides information from front and back ends.

Price: FREE | More information

How to Remove Author and Date Information Using the Divi Blog Module

If you’re a Divi or Extra user, we’ve made it super simple to remove the author and date information from your content.

In the Divi Builder, insert a single-column row to host your content.

How to Remove Author and Date from WordPress posts

Next, click on Insert Module(s), and in the popup select Blog.

How to Remove Author and Date from WordPress posts

You will be directed to the General Settings tab of your Blog module. Here you’ll see lots of options to help you tailor your module’s appearance and content, including the layout, number of posts, and which categories you want to display.

If you scroll about halfway down this tab, you’ll see a series of toggles that will let you remote the author and date information from your blog display.

How to Remove Author and Date from WordPress posts

Simply move any or all of these to show No, and that’s it! The information won’t be displayed on the posts that appear within this module. And if you want the information removed from the blog posts themselves, you can do that from within the Divi theme options. Just go to Divi – Theme Options – Layout. Within that section, you will see a tab labelled Single Post Layout.

All you do is click the author and date to grey them out, and all individual posts will now only display the categories and comments. Which can also be greyed out, if you so desire.

And voila, you can now remove the author and date from any WordPress post using Divi’s theme options or the built-in blog module.

Conclusion

Although author and date meta tags have their benefits, they’re not appropriate for every website. Or even every post. Whether you have evergreen content, a single author site, or another reason for meta removal, it’s good to know how to hide or remove author and date information.

Luckily, it’s simple and easy, and you’ve got options abound. You can either manually remove the meta information from your theme files or insert some simple CSS, use a plugin like WP Meta and Date Remover, or use the Divi Blog module to simply toggle it on and off.

Why have you had to remove author and date from WordPress posts before? What method did you use?

Article thumbnail image by Denis Demidenko / shutterstock.com



Source link

Poster le commentaire

Votre adresse e-mail ne sera pas publiée.