I love working with WordPress, it makes so many things easier for clients and it gives me as a web developer a great deal of flexibility to extend and offer to clients what they need for their websites. Unfortunately there are also times working with WordPress makes me scratch my head, this was one of those times.
One of my clients WordPress websites seemed to be crawling, it was just not loading quickly at all yet nothing seemed to have changed on the site. There had been a slight change with the main menu on the site so I thought perhaps there was a problem with the new menu options and I decided to log the slow MySQL queries to see I could find out.
After awhile I came back to look at the the MySQL slow queries log and to my surprise I found the following slow query over and over again:
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
I was shocked by the fact that the main problem with the site seemed to be the main options table. After doing a little Googling on the query I came across this excellent post “WordPress wp_options table autoload micro-optimization” and decided to try adding an index to the wp_options table and see if it helped speed up the clients WordPress website.
While the post I linked to used the command line, I actually used PHPMyAdmin to add the index to the autoload column. I am always cautious when working with the WordPress database, so I made sure I had a backup copy of the database before messing with it, and added the index. I then cleared the MySQL slow queries log and waited. Of course I checked the clients website to make sure everything looked ok and I was optimistic this had fixed the problem. The site was already responding much faster than it was earlier.
After a few hours I went and checked the slow queries log again and the slow queries on the wp_options table had disappeared. There are still some slow queries to deal with including one with WordPress SEO from Yoast and transients but the wp_options autoload query seems to be fixed for now.
What I am not sure of, is why does the WordPress team not have an index on the autoload column? Considering how much the options table is used to store plugin and theme data (with right or wrong I will not comment) but the fact that the options table is used for saving WordPress transients would suggest to me that perhaps that column should be set with an index by default.
If your WordPress website is starting to seem a little sluggish this is something else you might want to look into doing to speed your website up. If you are not comfortable with working with your WordPress database feel free to contact me I will be glad to help.
Adding the rel=”nofollow” on links in WordPress can be a pain especially if you want some links to be nofollow and some to be followed. Thankfully with the WordPress Rel Nofollow Checkbox plugin you can simply create your links how you normally would and just select the checkbox if you would like it to be nofollowed.
There are a number of nofollow plugins in the WordPress plugin repository but this one is my favourite. The simplicity of being able to just click the checkbox on the links I want nofollowed instead of making something complicated the nofollows all links on a website or all external links.
This is one of those plugins I wish I have created and is really useful on the publishing side of WordPress. If you have been looking for a simple nofollow plugin for WordPress take a look at the Rel Nofollow Checkbox plugin
I am always on the lookout for new and interesting photos for use in websites, blog posts and to pass on to clients. There are several places you can get free photos to use, in fact here is a list of 30 of them, but finding the perfect photo, downloading and uploading it again in your WordPress website gets tiring. This is where the Unspash WP plugin comes in.
Installing the Unsplash WP Plugin gives you an easy way to find a great photo to add to your website and the plugin takes care of adding the photo to your local media library so you just have to click and select the photo you want. The image is automatically downloaded and you just need to insert the photo from your media library.
While the selection of photos from Unsplash is still limited the selection is constantly getting better and the ease of adding the photos to enhance your website is worth taking a look the the Unsplash WP plugin.
I have talked about CloudFlare before and there are many reasons why you should use them, from helping to speed up your website to making it easy to monetize your website using Viglink. If none of those reasons convinced you why you should use CloudFlare perhaps this one reason alone will help convince you. You can use CloudFlare page rules to protect your WordPress powered website!
One of the great things CloudFlare has introduced is page rules. You can define a page rule to have different rules from the rest of your website. To help protect your WordPress website from a brute force attack, where usually an automated bot, hits your wp-login.php page again and again and again trying to get entry you can simply create a page rule in CloudFlare to protect the page. This can slow and often stop the brute force attack because the bots will either be stopped dead by the CloudFlare check or slow them down so much that it will take them much longer to actually try to login.
Free accounts with CloudFlare only get three page rules, and you will need two of them to protect your wp-login file. You might be able to get this down to one if you do some .htaccess redirects but to keep it simple lets stick with the two CloudFlare page rules. The two page rule URL patterns I have been using for the WordPress login page are:
You have to enter each one separately but it is much easier than trying to do this through .htaccess. The important part after you have added a page rule URL match is in your rules make sure you turn the Security and Browser Integrity to ON and set the Security Level to Help, I’m Under Attack.
This will cause CloudFlare to closely inspect every visit to your wp-login.php page. This will also slow you down when you go to login to your website unless you whitelist your IP address with CloudFlare. Then you will bypass this and be sent straight to the login.
This will not totally protect your WordPress website but it will provide an extra layer of protection from brute force attacks. It is still important to use strong passwords, keep your WordPress install up to date and you can try some plugins that limit the number of login attempts.
Optimizing your WordPress site to be faster is good for your users, but it is also good for your search engine results. It is one of the things that is in your control. One of the best ways to optimize your PNG images is to use TinyPNG. Previously you had to manually use the site to optimize your PNG images and then upload them again to your server. Not a very friendly or easy way of doing things. Thankfully TinyPNG has now developed an API and there are several WordPress plugins that have been developed to take advantage of it.
For all of these plugins you need an API key from TinyPNG. You can get one for free at their developer page. You can use it free for up to 500 images a month but after that you need subscribe to one of their paid plans. For many bloggers 500 images a month is a lot but remember for every PNG image you upload WordPress makes several version all that need to be compressed and optimized.
This is my favorite TinyPNG plugin and the one that I have actually installed here on WP Paradise. The plugin integrates nicely with the existing media gallery in WordPress allowing you to automatically optimize all new PNG images that you upload and optimize existing PNG images on your WordPress website.
This might have been the first TinyPNG plugin added to the WordPress plugin repository. It provides you with an alternative to use TinyPNG. It does not integrate with the media gallery in WordPress, which could be good if you only use PNG’s occasionally and want to have control over what images are optimized or not.
This plugin was released just a couple days ago and has a few more options than the other two TinyPNG plugins. It also integrates with the media gallery but has an option to keep the original file.
Optimizing your images goes a long way to speeding up your website for your visitors. These TinyPNG plugins make it even easy to make sure your PNG files are the smallest file size they can be. Take a look and let us all know what you think in the comments.
A common question from people as they are searching for a theme for their WordPress website is what theme is ____ website using? If you know HTML/CSS it is pretty easy to look at the code and determine what the theme is and where that website got it from. If you don’t know HTML/CSS here are three easy tools that you can use online to quickly discover more about that theme.
WordPress Theme Detector
Enter the URL of the WordPress website you want to find out more about the theme and this website will give you the details about the theme and occasionally some details about additional plugins on the website. The details for the plugins was not always 100% accurate but the theme detection on the sites I tried was always pretty good.
What WordPress Theme Is That
Similar to the WordPress Theme Detector above visit the site, enter URL of a WordPress website and get the theme details. Pretty much the same type of details are returned.
This is a little different from the other two. It is a Chrome extension that you can install and get the theme details for WordPress and Joomla based websites. Pretty handy if you are looking up themes all the time and don’t want to visit another site to do it. Just click the button in Chrome and the information is returned.
Now you know how to look up what theme websites are using without having to learn HTML/CSS. Makes it easy if you come across a theme that you really like and would like to download or buy as well.
One of the new features in the WordPress 3.7 is the ability for WordPress to be able to update itself. This has also been one of the more controversial features, but personally the new ability to had WordPress automatically update when a new security update is available is a fantastic idea. If you are not comfortable with WordPress auto updating you have a couple of choices to turn off auto updates.
If you are comfortable with editing the WordPress configuration file you can easily following the instructions at WPBeginner.com. Just a simple matter of editing your wp-config.php file and adding the following line:
define( 'AUTOMATIC_UPDATER_DISABLED', true );
If you do not want to mess with code, and lets face it most people don’t, you can check out the new plugin called Update Control. It looks like it gives you the control you would want to control your automatic update all without editing the wp-config.php file.
Which method do you prefer?
Great images in your blog post is great for readers, but there is a catch to using lots of images on your site. All those images can slow down how fast your website loads. There are many different ways to speed up the load time of your WordPress website but an easy way if you use lots of images is to take advantage or lazy loading. Lazy loading images is essentially loading them on demand when the user needs them. If the image is place lower down on the page, load the page and then load the image when then user starts scrolling down to wear that image is. Here are some of the plugins I found that can help you set up your website to use lazy load images.
This plugin only has one review but it sounds like it does what it is suppose to. No fancy stuff here just install it and it starts working. No settings to worry about, just a simple lazy loader. Is you want simply might be just the one you are looking for to speed up your website.
You do have some settings for this plugin but mostly for settings styles if you want to do something special. Again pretty simple and the couple reviews rate it high.
This plugin is new to the WordPress Plugin directory as of today, October 24, 2013. This plugin might be new but the developer has several other plugins.
This plugin has the most reviews and many are positive. Appears to do what it is suppose to do.
These plugins are just one way to help speed up your WordPress powered website but can be very effective if you have a number of images on your website. If your site is still slow after using one of these plugins you could have other problems with your website that you might want to look into. Using a free tool like Pingdom Tools might help you to determine where the slow down in your website load times are.
A question I get asked fairly often is how to duplicate a post in WordPress. There are many plugins available to do this for you but I like to use Duplicate Post.
Duplicate Post is a free plugin which allows you to clone a post or create a draft post based on a previous post (which is the option we tend to use more often.) The plugin also offers the same functionality for pages as well. There are also customisable options on what is copied when you duplicate the post such as date, attachments etc.
How It Works
On the ‘All Posts’ screen, there are new options under each post title: clone andnew draft.
I tend to use the new draft option as it creates a draft post identical to the original and allows you to edit it before publishing.
Important: when you create a new draft, the permalink is also copied with a ’2? added to the end. Obviously you will need to change this to something more meaningful before you publish.
This is one of those ‘does what it says on the tin’ plugins. It is simple and saves a lot of time especially if you are creating similar posts or pages on a regular basis.
A project I was working on today uses custom post types for part of the content of the website. In this case though some posts in the custom post type need to be sticky. Well the client did not call it that but in the end that is what they described, those posts need to be at the top of the list when readers browse that section of the website and it needs to be easy for them to be able to change the sticky posts easily.
The site is using the Pods Framework to create the custom post type and I thought I must have missed the option to turn sticky posts on but after some searching I came to the conclusion I did not miss it, it is not there. I then went looking for a way to enable sticky posts for custom post types.
Thankfully the WordPress community often has a plugin that can solve problems like this and a quick search in the WordPress plugin directory and I found the Sticky Custom Post Types. Once the plugin was installed it was just a simple matter of going to Settings ? Reading and turning sticky posts on the custom post type I needed them on.
The plugin has not been updated for over a year but it is still working as expected when I installed it today. My client can now select sticky posts for their custom post type content and if they decide to use it on another custom post type they will have no problem turning it on or off.