Introduction
WordPress is a very flexible platform that allows for many plugins or customizations to make every website unique. This guide provides some more advanced steps to optimize your WordPress installations.
Please note that the suggestions in this article require a bit more knowledge of the file system of your WordPress installation as well as the database that it operates on. We recommend contacting a system administrator or WordPress developer for optimization assistance if you are not comfortable performing these steps on your own.
Procedure
- Enable browser caching by adding the following code to the site's
.htaccess
file.## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType text/css "access 1 month" ExpiresByType text/html "access 1 month" ExpiresByType application/pdf "access 1 month" ExpiresByType text/x-javascript "access 1 month" ExpiresByType application/x-shockwave-flash "access 1 month" ExpiresByType image/x-icon "access 1 year" ExpiresDefault "access 1 month" </IfModule> ## EXPIRES CACHING ##
- Optimize images for the internet before you upload them to your website. Most photo editing applications can let you do this via a "Save for Web" option.
- Limit crawlers and bots from crawling your site by adding them to your site's
robots.txt
file. - Limit spam comments by using a plugin that automatically removes spam comments.
- Split comments into pages with the "Break comments into pages.." option of the site's "Discussion" settings.
- Limit post revisions by adding the following code to your site's
wp-config.php
file.define( 'WP_POST_REVISIONS', 3 );
Please note that post revisions can be disabled by adding the following line instead.define( 'WP_POST_REVISIONS', false );
- Disable hotlinking and leaching of content by adding the following to your site's
.htaccess
file.#disable hotlinking of images with forbidden or custom image option RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.tld [NC] RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]
Please note that "domain.tld" must be replaced with the site's domain name. - Use a Content Delivery Network (CDN).
Additional resource
Basic WordPress Optimization Steps
How to Limit Crawlers & Bots From Crawling Your Site
Comments
0 comments
Article is closed for comments.