Category Archive: WordPress
Posts about WordPress
WordPress Remove Menu Item
Quick WordPress tutorial for you today. How to remove an unwanted item from the WordPress menu. You know, the main menu that you find on the left-hand side of the screen when logged into the WordPress Admin Area. If you have a menu item that you want to remove, this post shows an easy way […]
WordPress Trigger 404.php Template
Recently I needed a programmatic way to trigger a 404 error in one of my free WordPress plugins. Fortunately WordPress makes it very easy to do. This quick tutorial explains two different ways to make it happen.
WordPress pre_get_posts example
Here is a quick example showing how to modify the main WP Query (Loop) using the pre_get_posts filter hook.
Secure WordPress Login Page
If you try to log in to some of my WordPress-powered sites via the WP Login Page, you will be met with a 403 “Forbidden” response. For sites where I am the only registered user, I lock things down to prevent endless waves of drip force attacks. It really helps to reduce server load, conserve […]
Find Password Protected Posts in the WordPress Database
Recently I needed to view all posts that were password-protected. Not finding a WordPress function for this, I wrote a quick SQL command to find all password-protected posts in the WordPress database.
Remove All Matching Options from the WordPress Database
Typically when you want to remove an option from the WordPress database, you can use a function like delete_option(). But there are cases where such functions are insufficient. For example, in a previous version of my plugin Blackhole for Bad Bots, a database option is added for each blocked request, and each option name includes […]
WordPress: Add “View HTML” Button on Edit Post Screen
On a recent project, I found myself viewing the HTML source for every post and page on a WordPress-powered site. After about a thousand clicks, I decided to write a code snippet that adds a “View HTML” button (it’s actually just a link) for each post row displayed on the WordPress “Edit Post” screen. So […]
Video Tutorials: Running WordPress on Shared Hosting
After months of hard work, I am pleased to announce the launch of my new video course on running WordPress on shared hosting. This course shows you how to get your own WordPress-powered site up and running as quickly and inexpensively as possible. It walks through the entire process step-by-step, with helpful visuals and examples […]
WordPress Navigation Links for Monthly Archives
Archives that are easy to navigate make your WordPress-powered site that much more awesome. There are plenty of great strategies for increasing the usefulness of your post archives. For example, this quick tutorial provides some custom functions that display monthly navigation links. So you can display “Previous Month” and “Next Month” links on monthly archive […]
Restore Removed Query String Paramaters in the WP Admin Area
Developing my WordPress plugins recently, I noticed that Chrome was removing the query-string parameters from the URL as displayed in the browser’s address bar. Likewise Firefox and others were not showing the full URL in the address bar, which was making development difficult, as I was testing URL redirects involving query parameters at the time.
Add Defer and Async to WordPress Enqueued Scripts
When adding JavaScript in WordPress, it sometimes is necessary to add attributes such as async and defer to the <script></script> tag. Here is a technique to do it with any WordPress version 4.1 and better.
Disable Chrome XSS Auditor
Working on WordPress development and testing HTML forms in Chrome browser, I ran into the following error: This page isn't working Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers, and credit cards). ERR_BLOCKED_BY_XSS_AUDITOR