Getting thousands of spam comments

You can prevent some hits by blocking bots before akismet catches them, these plugins can be very effective. Plugins: Bad Behavior plugin: http://wordpress.org/extend/plugins/bad-behavior/ Honeypot Traps: http://wordpress.org/extend/plugins/project-honey-pot-spam-trap/ WP-Hashcash http://wordpress.org/extend/plugins/wp-hashcash/ Zig Trap http://wordpress.org/extend/plugins/zigtrap/ Stop bots with no user agents from posting and directory browsing (this goes in your .htaccess) RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{HTTP_USER_AGENT} ^$ … Read more

WordPress site causing lots of server IO

1) Try WordPress › WPDB Profiling « WordPress Plugins to see what is running all the queries. 2) Clearing post and page revisions will greatly reduce the size of a WP database – up to 90% in some cases – with a huge return in speed and lower server load. Run as SQL query in … Read more

A problem with date archives

The problem is that the plugin only handles the calendar part, and not the archive query. What you need to do: Change the main query on archive pages if the post_type argument is present, eg: http://localhost:8888/wp/?m=201105&post_type=candy : add_filter(‘pre_get_posts’, ‘atom_include_cpt_in_archives’); function atom_include_cpt_in_archives($query){ // validate if(is_archive() && isset($_GET[‘post_type’]) && post_type_exists($_GET[‘post_type’])) $query->set(‘post_type’, $_GET[‘post_type’]); return $query; } Next, you’ll … Read more

just show the field comment by clicking button

you can do this very easily with jQuery simply wrap your comment form in a div and hide, add a button or a link and on his click event show the comment form so smoothing like this: <a href=”#” ID=”Leave_a_comment”>Leave a Comment</a> <div id=”comment_form_wrapper” style=”display: none;”> <?php comments_template( ”, true ); ?> </div> <script type=”text/javascript”> … Read more

Need some PHP schoolin’! passing var to url and the old options table

PHP (as usual) has some nifty stuff, namely http_build_query() for putting together URL requests. However for some reason (historically) PHP4 compatibility and encoding issues currently WP maintains fork of that function internally and offers build_query() wrapper, as well as nifty higher level function for URL manipulation add_query_arg() and remove_query_arg().