36 posts

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 […]

Smooth Scroll to Page Top without an Anchor

This little jQuery snippet adds a smooth scroll-to-top effect on a page.  Unlike some other methods, this doesn’t need an anchor for the scroll effect to work on a page. You can change the scroll speed and “scroll up to” position in this script. $(document).ready(function(){ $(“.top”).click(function(e){ e.preventDefault(); $(“body,html”).animate({ scrollTop: 0 // Top […]