{"id":761,"date":"2013-05-11T14:51:25","date_gmt":"2013-05-11T13:51:25","guid":{"rendered":"http:\/\/local.sandjam.co.uk\/?p=761"},"modified":"2018-08-03T13:55:51","modified_gmt":"2018-08-03T12:55:51","slug":"wordpress-optimisation-checklist","status":"publish","type":"post","link":"https:\/\/sandjam.co.uk\/sandjam\/2013\/05\/wordpress-optimisation-checklist\/","title":{"rendered":"WordPress Optimisation Checklist"},"content":{"rendered":"<p>WordPress is a framework which is great for rapid development because it is so quick and easy to set up. Check out the famous <a href=\"http:\/\/codex.wordpress.org\/Installing_WordPress#Famous_5-Minute_Install\">WordPress 5 minute install<\/a>.<\/p>\n<p>However, if you want to really make sure that your installation is working as efficiently and securely as possible, there are a few extra tweaks I tend to add in to most sites I set up.<\/p>\n<h2>Table Prefix<\/h2>\n<p>During the setup, you are prompted to set a couple of site variables. It&#8217;s easy to skip these and leave them as their default values, but don&#8217;t.<\/p>\n<p>Changing the default table prefix from &#8216;wp_&#8217; to something else means that:<\/p>\n<ul>\n<li>You can have multiple WordPress sites on one database without overwriting eachother&#8217;s tables.<\/li>\n<li>If a hacker gains access to your database, they will have a harder time working out what tables you have.<\/li>\n<\/ul>\n<h2>Admin Username<\/h2>\n<p>Don&#8217;t leave the default admin user called &#8216;admin&#8217;. Brute force attacks can more easily gain access if they only have to guess the password.<\/p>\n<p>This must be done when you first set up the site as it&#8217;s lots more difficult to change the admin username after the initial setup.<\/p>\n<h2>Limit Previous Post Versions<\/h2>\n<p>WordPress keeps previous versions of posts which is handy in case you accidentally save something and you want to revert a post. However this can result in bloated database tables if your site has a lot of posts or is updated frequently.<\/p>\n<p>By adding this setting in to your wp_config.php file you can limit post revisions to something reasonable, or disable revisions altogether.<\/p>\n<pre class=\"qoate-code\">\r\ndefine('WP_POST_REVISIONS', 3);\r\n\r\nor\r\n\r\ndefine('WP_POST_REVISIONS', false);\r\n<\/pre>\n<h2>\u00a0Autosave Interval<\/h2>\n<p>WordPress automatically saves posts as you write them every 60 seconds. This adds a little more overhead to the page, and is usually a bit unnecessary.<\/p>\n<p>Adding this setting into wp_config.php allows you to amend this interval to something more reasonable like 5 minutes.<\/p>\n<pre class=\"qoate-code\">\r\n\r\ndefine('AUTOSAVE_INTERVAL', 300);\u00a0\u00a0 \/\/ 5 mins\r\n\r\n<\/pre>\n<h2>\u00a0Move wp_content Directory<\/h2>\n<p>There are some security advantages to moving your wp_content directory away from the site root. It may deter some automated bots which scan your domain for recognised directory patterns.<\/p>\n<p>Anybody who looks even a little more closely at your site will still be able to work out where wp-content is, but it&#8217;s another small step towards making your site look a little less like a standard WordPress installation.<\/p>\n<pre class=\"qoate-code\">\r\n\r\ndefine('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'].'\/path\/wp-content');\r\n\r\ndefine('WP_CONTENT_URL', 'http:\/\/mysite.com\/path\/wp-content');\r\n\r\n<\/pre>\n<h2>\u00a0Thumbnail Sizes<\/h2>\n<p>One of my biggest problems with WordPress is its greedy habit of creating thumbnails of all sizes for every uploaded image, whether that thumbnail is used or not. This can cause your uploads directory to grow very large very quickly, so anything that can be done to keep this in check is useful.<\/p>\n<p>If your theme uses custom image sizes, update the thumbnail sizes in <strong>Settings &gt; media<\/strong> to be the same as those in your theme. If you don&#8217;t need any of the default image sizes like &#8216;medium&#8217; or &#8216;large&#8217; set the width and height values to zero to prevent WordPress from generating these thumbs.<\/p>\n<h2>Cache Plugin<\/h2>\n<p>It&#8217;s useful to have a cache plugin like <a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-super-cache\/\">WP Super Cache<\/a> set up on your site, even if you don&#8217;t think you need it right now.<\/p>\n<p>When your site becomes so popular that the server starts to fall over, it&#8217;s a lot harder to start installing a cache plugin. Have the plugin ready to go, and you can just activate the cache or even use the &#8216;lockdown&#8217; mode if your site happens to get <a href=\"http:\/\/www.techradar.com\/news\/internet\/how-stephen-fry-takes-down-entire-websites-with-a-single-tweet-674170\">tweeted by Stephen Fry<\/a>.<\/p>\n<h2>Comments<\/h2>\n<p>If your site is going to use comments, definitely sign up to <a href=\"http:\/\/akismet.com\/\">Akismet <\/a>which will help filter out spam comments.<\/p>\n<p>If you&#8217;re not using comments, make sure you disable all the comments features in <strong>Settings &gt; Discussion<\/strong> to make sure people can&#8217;t sign up or submit content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress is a framework which is great for rapid development because it is so quick and easy to set up. Check out the famous WordPress 5 minute install. However, if you want to really make sure that your installation is working as efficiently and securely as possible, there are a few extra tweaks I tend [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":762,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4,45],"tags":[66,36,37,12],"class_list":["post-761","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code","category-wordpress-development","tag-plugin","tag-tips","tag-tricks","tag-wordpress"],"acf":[],"_links":{"self":[{"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/posts\/761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/comments?post=761"}],"version-history":[{"count":3,"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/posts\/761\/revisions"}],"predecessor-version":[{"id":1084,"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/posts\/761\/revisions\/1084"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/media\/762"}],"wp:attachment":[{"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/media?parent=761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/categories?post=761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sandjam.co.uk\/sandjam\/wp-json\/wp\/v2\/tags?post=761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}