Comments system doesn’t like International domains

WordPress’ internal email validation is very weak. I’ve written a plugin some time ago to catch most cases where WordPress fails: Extend Email Checks. It uses PHP’s filter_var(). But there are some edge cases, where it doesn’t work good enough. Give it a try.

Ability to leave comments broken

Verify comments are enabled by default: Dashboard -> Settings -> Discussion -> Default article settings. Verify comments are enabled for all posts/pages: Dashboard -> Posts -> Check all posts. -> Bulk actions (Edit) -> enable comments. Same thing for pages. Verify your template files. Do you still have a comments.php file?

Make WordPress process admin group comments using $allowedtags

kses_init is hooked onto the init hook with default priority, and (after first removing any of the kses filters) adds filters which strip out tags (wp_filter_post_kses for posts and wp_filter_kses for comments) if the user does not have the capability ‘unfiltered_html’. Since the capability determines whether or not the user can post ‘unfiltered_html’ comments and … Read more

how to properly use comments-template.php

It depends on how your theme is built & we can’t be 100% sure if this is right without seeing the code but most probably comments_template is the wrong function. Take a look at the comment_form function http://codex.wordpress.org/Function_Reference/comment_form comments_template is the function generally used to include the comments file(basically to display the contents of comments.php, … Read more

Same email for all comments

Just change to to address for these emails. Sample code, not tested: // hook in late, to avoid side effects. add_filter( ‘comment_notification_headers’, ‘wpse_73855__change_comment_notify_to’ ); function wpse_73855__change_comment_notify_to( $input ) { if ( ‘comment_notification_headers’ === current_filter() ) { add_filter( ‘wp_mail’, __FUNCTION__ ); return $input; } $input[‘to’] = get_option( ‘admin_email’ ); remove_filter( current_filter(), __FUNCTION__ ); return $input; }

Delete all one-word comments

DISCLAIMER : Not a WordPress Developer, Just a MySQL DBA If you have privileges to login to MySQL and query data you could collect all the comment_ID values that have one word. SELECT comment_ID FROM wp_comments WHERE REPLACE(TRIM(comment_content),’ ‘,”)=TRIM(comment_content); You can test this by also seeing the comment_content SELECT comment_ID,comment_content FROM wp_comments WHERE REPLACE(TRIM(comment_content),’ ‘,”)=TRIM(comment_content); … Read more

Comment Moderation and CDN Caching

Figured it out. Looking at wp-comments-post.php there is a filter called comment_post_redirect which I used to check if the comment was approved and then added a query string to the URL. So easy. //A query string needs to be added when redirecting back to the post after a comment is posted and not approved. This … Read more

Filter In Reply comments from WordPress Admin Panel

In your comments loop, skip the children: if( !empty( $comment->comment_parent ) ) { //if the comment has a parent, skip it as it’s not level 1 continue; } Edit: Above example would only help in the reading loop, below example should help in admin area: add_filter(‘the_comments’, ‘top_level_comments_filter’); function top_level_comments_filter($comments){ global $pagenow; if($pagenow == ‘edit-comments.php’){ foreach($comments … Read more

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