Snippets Collection 3

WordPress CMS

How To Disable WordPress Comments Completely

The following snippet will let you disable WordPress comments completely.

Snippet Source/Credit:

How To Automatically Delete Trash On Daily Basis

When you delete a post or a page or a comment, it goes in a Trash instead of being removed permanently. Using the following snippet will ease you job of deletion and will tell WordPress to automatically delete the trash itself. Simply copy and paste the following lines of code in your wp-config,php file and you are done.

Note: Make sure that you do replace 1 by X to empty spam comments automatically every X days.

How To Show Content For Logged In Users

Adding this snippet to your theme’s functions.php file will let you show content only for logged in users.

Snippet Source/Credit: Snipplr

How To Redirect Users To A Random Post

The following snippet will let you redirect users to a random post.

Snippet Source/Credit: Smashing Magazine

How To Have Custom Favicon For Your WP-Admin

Using the following snippet, you will be able to have custom favicon for your WP-admin.

Snippet Source/Credit: Snipplr

The Editorial Team

The Editorial Team

The Editorial Team at JustWP is a team of WordPress experts led by Karan Chopra.

You may also like...