Getting rid of author, date and comments on posts
Is there any way to delete this on all my posts/pages
Hi Yes there certainly is. Involves a little editing of the code, but not much at all. If you edit single.php and page.php and change/remove the following lines
<div class="metabox">
Posted by <?php the_author_posts_link () ?> |
Filed under <?php the_category(', ') ?> |
<?php the_time('M j, Y') ?> |
<?php the_tags('Tags: ', ', ', ' | '); ?>
<?php comments_popup_link(' No Comments', ' 1 Comment', ' % Comments'); ?>
</div>
Thats all the meta for each post. Ill break it down so you can see which is which
Posted by <?php the_author_posts_link () ?> |
Thats the posted by code, so if you dont want the author name, get rid of that bit.
Filed under <?php the_category(', ') ?> |
Above code is the Category links, so delete that if you dont want the categories showing.
<?php the_time('M j, Y') ?> |
Above is the time the post was created, so you can do away with that if you wish.
<?php the_tags('Tags: ', ', ', ' | '); ?>
Above are the tags, again delete as necessary.
<?php comments_popup_link(' No Comments', ' 1 Comment', ' % Comments'); ?>
And finally, above is the comments, just delete that line to get rid of the comments.
As you can see, it breaks down into lines, so this should be easier for you to delete as necessary.
11 Responses to “Getting rid of author, date and comments on posts”
You must be logged in to post a comment.






jana:
So I should delete the stuff in blue if I don’t want posted by , the date or “comments” right under the title ? Sorry, I’m not very technical…
Jana
Factory42:
Sorry about that Jana, was in a bit of a rush before. I sometimes think everyone knows Wordpress! haha, I shouldnt be so presumptuous!
I have updated the post above with clearer details for you. Hope that helps, if not let me know!
jana:
Thanks so much! I was able to make the changes. Great support here!
Dave:
Is it possible to make it so that people can do all this from the dashboard?
Factory42:
HI Dave, yeah it should be in there really. We did have something approaching this in an earlier version, but it became a mess to be honest so we dropped it.
Its going on the feature request link and will be added. That may not be for a few weeks though but it will go on there. Thanks for the suggestion!
Uwe:
Hi!
What’s wrong with my single.php? The changes in the editor are not working, but they are on the page.php.
On the page.php I would like to delete the footlines:
“Leave a Reply
Logged in as moderator. Log out
Comments links could be nofollow free.”
What do I have to do?
Thanks
Factory42:
Please see the comment reply below, you need to edit comments.php
Leopoldo:
Same problem here. I deleted these lines, but it did not change nothing at all in the single posts. It worked well in page.php
Thanks
Factory42:
Do you mean deleting the Meta (category name, author etc) below the post of the “leave a comment reply” They are two completely different things. If you want to edit the meta then follow the instructions above, they do work.
If you want to change the “Leave a reply” link you need to edit comments.php at line 35 and remove the text you dont want. Thanks!
ni4:
Hey Dave,
I’m having the same issue. I used this tut to get rid of the “posted by____ Filed under____ (Date) etc”
It worked on the pages, but on my home page (the page I really want it off of) it didn’t work. I’m brand new to this stuff, but I am pretty competent at following directions and working on computers and did exactly what you said.
Could you help out a bit here – thanks a bunch!
ni4:
Sorry, misread the posts. I should be asking Factory 42, not Dave:
I’m having the same issue. I used this tut to get rid of the “posted by____ Filed under____ (Date) etc”
It worked on the pages, but on my home page (the page I really want it off of) it didn’t work. I’m brand new to this stuff, but I am pretty competent at following directions and working on computers and did exactly what you said.
Could you help out a bit here – thanks a bunch!