How to make WordPress Faster and more optimized | Web Hosting Forum

Welcome to Our Community

Wanting to join the rest of our members? Feel free to sign up today.

Sign Up

How to make WordPress Faster and more optimized

Discussion in 'Content Management Systems' started by Afro head, Jun 30, 2017.

  1. Afro head

    Afro head New Member

    Money:
    $3
    Hey guys, today will talk for some really bad web practices and recommendations on what you have to do on your wordpress website in order to make it faster and more optimized, based on thousands of emails I receive from my customers and troubleshooting I experience on a daily basis.

    Most of these can be the difference between having a blazing fast wordpress site and a ... failure.

    So how to make wordpress faster? Of course picking the right web host is very important (here we always go with CyberHour as they are the best wordpress hosting provider in europe!). Apart of that , you have to educate yourself on how to optimize wordpress site!

    Remember, Live websites are NOT for dev work! Don't ever use a live (public) site for dev work! NEVER! There is possibility to break things while testing random thinks on a live site which will lead to critical downtime. If you don't have spear space for cloning your website under subdomain then you can always test and develop locally using free LAMP stack. I recommend using DesktopServer for this purpose.


    3. Don't edit your code if you are NOT a developer!
    Seriously guys, people that are unfamiliar with wordpress and don't have basics php skills should NOT edit files. The most common reasons for wordpress website to go down <<white screen of death>> is because someone edited a PHP file directly from the dashboard!

    So if you are developer would suggest to place the following code in the wordpress configure file to remove the edit_files,edit_themes,edit_plugins capabilities from ALL USERS! This will save you hours of work when you will have to fix it later!

    Code:
    define ('DISALLOW_FILE_EDIT', true);

    Would be nice to take it further, removing the option for clients to update themes or install plugins. To do this just add the following code (again in your wp-config.php).

    Code:
    define ('DISALLOW_FILE_MODS', true);

    4. Don't cut corners on Your Themes and Plugins

    As a developer, I understand that sometimes you have to save a few bucks, but don't do it with your templates and modules! Try to stick with reputable developers when picking plugins and of course always look over the ratings and reviews. Check how often they upgrade their plugins. It is very common , outdated (and bad coded) plugins/themes to get easily infected with malware or to be injected with bad spam links, etc.

    Did you know that almost 50% of the plugins today haven't been updated in over 2 years!

    5. Don't use third-party source for getting premium plugins/themes for lower cost or even free (aka nulled)

    Why? Well first of all, if you like a plugin/theme then you should support the developer by paying him for his work! Second, you are relying on the free source to grab the updates for you which again is not good since you never know what extras have been added (malwares/spam links etc).

    6. Watch over your admin AJAX calls
    Some wordpress plugins may utilize AJAX. One great example is WordPress Heartbeat API that uses /wp-admin/admin-ajax.php to run AJAX calls from the browser. Most of the times these can't be cached and during traffic spikes will cause high CPU load!

    If you need a plugin which utilize admin-ajax.php, make sure that is used in the correct way.

    NOTE: AJAX loads after the page loads. So just because you see it in a speed test results, doesn't necessarily always means that is a bad thing!

    7. Take it easy with the Ad Networks!
    Ok! We all want to monetizate our blog , most popular websites rely on ads for their income. So removing Adsense (for example) is not an option. However, it is really important to keep the number of the banners ato a minimum .

    For example: A single 300x250 Google Adsense banner will add up to 2 seconds loading time to your website !

    You don't want that right? What would suggest here is to optimize your wordpress to load JavaScripts after your site content. After all, the most important thing is to deliver YOUR content faster!

    8. Over WordPress optimizing can hurt your performance!

    There are hundreds or even thousands of tutorials online where random gurus give random "tips"on how to speed up and optimize wordpress site. But an even worse scenario is to over optimize your website! This happens for real! Actually it is common for webmasters who thinks that by adding more of something it will x2 their loading speed.

    DON'T TRY TO CACHE THE CACHE!

    Unlike VPS hosting and standard basic hosting, a lot of managed wordpress host providers (including @CyberHour) have their own caching, which is done at a server-level (Memcache or Redis). Trying to cache the cache will lead to lot of errors including 502 gateway! So don't do it!

    Premium caching plugins like WP Rocket are good, but are designed for servers which need additional speed boost.

    9. CDN over CDN ! More is better right?
    CDN (content delivery networks) may greatly decrease loadtimes and latency between visitor computer and website. one of the most popular providers is Cloudflare.

    Do you know that I see users stacking CloudFlare with KeyCDN or MaxCDN along with it? All because they read somewhere in a pure BULL.S blog from someone recommending taht they should go install this new service right away, and they simply do it!! Without thinking about their existing setup! Of course this combination may work in certain scenarios, typically this ends up in a giant mess! Pick one CDN and stay with it, don't like it? Remove the first before moving to new one!

    10. Modifying WordPress core is BAD!
    Plain & simple, modifying your wordpress core can expose your wordpress site to security vulnerabilities. !

    11. PHP7 is faster than PHP 5.6 BUT is your website compatible with it?

    It's always satisfying to be using the latest PHP version. PHP 7 have been shown to boost PHP applications speed (Wordpress is based on PHP). Before upgrading to PHP 7 you should make sure that your website is compatible with this version. When you are about to move from older version to 7, you should always test all functionalities of your WP site locally. Most of the times , outdated plugins / themes are not working over PHP 7, which would mean that you should wait the devs to upgrade or remove them.

    12. Have a large website? You should Optimize your Database!
    One of the easiest ways WP sites to slow down like a turtle is when the DB hasn't been optimized. Do you know that simple tasks like cleaning up old WP revisions or cleaning up unused tables, can help prevent some of this slowdown!? Also , you should switch to InnoDB as is way faster than MyISAM!

    How to do it?

    Simply run the ALTER command to convert your tables to InnoDB storage engine.

    Code:
    ALTER TABLE  wp_comments ENGINE=InnoDB;
    
    Disable or modify the number of revisions

    Code:
     define (WP_POST_REVISIONS',  false);
    or to modify the number of revisions :
    Code:
    define (WP_POST_REVISIONS', 3); 
    There are many websites with over 300 revisions per post, which adds up with large sites very fast.

    13. If you don't need Multipurpose theme DON'T use it!
    The main problem with the WP community is that people go out and buy multipurpose themes and then only use 1% of the theme's features.
    Just because you see a fancy sliders on the demos that doesn't means that you will use all the features of the theme right? I'm not saying that multipurpose themes are bad! Just think before you buy your next theme!

    Hugs and Kisses
    Afro Head!
     
    #1
  2. Exotica

    Exotica New Member

    Money:
    $2
    Nice article OP,

    Just want to include that PHP 7.2 makes wordpress run even faster.

    Most newbies install random crap coded plugins which eat lot of resource and make sites slower.

    I'm also using the CDN service of CyberHour which is amazing !

    Cheers
     
    #2

Share This Page