Search and Delete Unused Post Tags in WordPress

Here are three SQL queries to find and safely delete all unused tags from your WordPress blog database. The below command will show you all the unused tags in the database. SELECT * FROM wp_terms wterms INNER JOIN wp_term_taxonomy wttax ON wterms.term_id = wttax.term_id WHERE wttax.taxonomy = ‘post_tag’ AND wttax.count […]

Display Simple Maintenance Mode Message to Non-Admins

Here’s a snippet to display a simple maintenance mode message to all non-admin visitors of your WordPress blog, while you carry on your tasks in the back-end. function wp_maintenance_mode() { if ( !is_user_logged_in() || !current_user_can( ‘manage_options’ ) ) { wp_die(‘Site is undergoing maintenance at the moment, please come back after […]