Friday, December 30, 2011

How to Automatically Empty WordPress Trash Daily

Leave a Comment
Every Blogger suffers from a problem which is of spam comments on blog.
There are thousands of spam comments evryday on
bloggers blogs, so deleting or emptying trash comments evryday is very difficult,how to overcome this problem?
lets see
WordPress can now permanently delete posts, pages or comments in the trash after 15 days automatically. So dont delete thousands of comments from Trash everyday.
Just use one line script

define('EMPTY_TRASH_DAYS', 15 );

The 15 in code signifies that it will empty trash after 15 days.
If you set to value to 0, the trash functionality will be disabled
and Delete Permanently button will appear in the place of Trash button and
then you can delete comments,posts and pages permanently without any alert.
Steps:
-Go to wp root directory.
-Find wp-config.php file and Open it.
-Copy and Paste this code anywhere.
-Save the file.
-Done!

Note: Always Remember to backup wp-config.php file before editing it unless your blog function may be may not work.



0 comments:

Post a Comment