How do i remove approved spam comments by date?

Unfortunately, WordPress does not provide any functions to select comments by date range, as far as I know. And although you could wp_delete_comment in a loop, it would take unnecessarily long. As the WordPress database entity relationship diagram shows, comments are limited to being in the wp_comments table and the wp_commentmeta table, which is convenient. … Read more

Give subscribers the option to post anonymously

You can allow anonymous comments in WordPress in wp-admin/options-discussion.php: Just do not check Comment author must fill out name and e-mail. There is a small usability catch: Sometimes users may just forget to fill in their data. I have added a small JavaScript confirm message box asking if they really want to send as anonymous … Read more

infinite loop on page with comments after changing comments.php and header.php

The article you’re using is quite old, from ~2009. There are much better cleaner ways of doing commenting. As a guide, follow this: http://ottopress.com/2008/wordpress-2-7-comments-enhancements/ This is the definitive guide to implementing Comments post v2.7, and Otto is widely respected in the community. Firstly, your comments code uses have_posts() to check if there are comments, instead … Read more

Editing custom fields for comments

I think you’ve way over-complicated things. Assuming private is a checkbox, just check for it being set, and act accordingly. With form $_POST data, a checkbox will send its value if checked, and will send nothing if not checked: if ( isset( $_POST[‘private’] ) ) { update_comment_meta( $comment_id, ‘private’, ‘private’ ); } else { delete_comment_meta( … Read more

Empty comments field or

The easiest way to achieve this is to use jQuery on the client side to handle this validation. There are a number of ways you can achieve this, though one of the easiest would be to use a ready made solution of which one can be found HERE You’ll need to download the plugin file … Read more

Modify links in user comments

To replace nofollow with nofollow external _blank Put this code in your theme’s functions.php file to replace text as required. function wpse_60668_relnofollow($text) { $return = str_replace(‘nofollow’, ‘external nofollow _blank’, $text); return $return; } add_filter(‘get_comment_author_link’, ‘wpse_60668_relnofollow’); //this’ll change author link add_filter(‘comment_text’, ‘wpse_60668_relnofollow’); //This’ll change the content

Can I create a new comment type?

Taking a quick look at comments.php, I can say – using custom comment type is so far legal, however I didn’t played with this yet but you can, and post back with your results if you found any illegal stuff in this. I found on codex the get_comments() function is accepting comment type as argument, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)