Remove admin name in wordpress comments class

May 25, 2010

Every time we posted a comment, WordPress automatically added a class that pretty much told everyone our admin login name. The offending class is the “comment-author-admin” class. We can created a code snippet that can quickly remove the offending class from every comment. Just add follow code to your functions.php file: function remove_comment_author_class( $classes ) { foreach( $classes as $key => $class ) { if(strstr($class, "comment-author-")) { unset( $classes[$key] ); } } return $classes; } add_filter(... [Read the full story]

Avoid duplicate content in wordpress paged comments

March 12, 2009

Introduced in WordPress 2.7, paged comments are great, especially when you have lots of comments. Thought, if your <title> tag isn’t optimized, your blog could produce some duplicate content, which is bad for SEO. To avoid duplicate content problems, you need a different title and a different meta description. The easiest way to do this is to add ‘Page X’ into the title and meta description of the blog post. Open your header.php file. paste the following code into your theme’s header just before... [Read the full story]

Suggest your visitors to leave comments in your rss feed

February 18, 2009

Most bloggers like to receive comments about their posts. How to display a message on your rss feed, and notifying your visitors that the discussion is open and suggesting them to comment? Additionally, when using WordPress as CMS, sometimes it is necessary to create new posts instead of pages for static pages because you want them to appear in the RSS feed. You may not want to enable comments inside those posts. At other cases, you may also want to selectively choose to enable and disable comments. The problem is, how do... [Read the full story]

Get rid of links in your wordpress comments

February 12, 2009

As you wordpress blog became one of the most popular WordPress related blogs, you had to face the problem of people inserting links in comments. Some links are relevant, but some aren’t at all. here is a solution to say goodbye to links in comments. Just paste this code in your function.php file. Once the file is saved, you can say goodbye to links and other undesired html in your comments. function plc_comment_post( $incoming_comment ) { $incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']); $incoming_comment['comment_content']... [Read the full story]

Display allowed tags in wordpress comments

February 10, 2009

Do you know that your readers can use some HTML tags in the comments form? In order to make things easier for them, you should notify your readership about what HTML tags they can use in the comment form. Here’s an easy way to do it. edit your comments.php file and paste the following code just above the comment form: Allowed tags: <?php echo allowed_tags(); ?>  Read More →