WordPress is a great tool that lets non-developers manage websites, but sometimes it can be slow or cause issues with website functionality. Optimizing WordPress involves more than just installing a few plugins and calling it a day. Following are our top pieces of advice for building or optimizing your WordPress website.

Don’t make code changes directly to your production website

At Gravitate, we make changes locally and deploy them as necessary to the various environments where your website lives. Depending on the size of your organization, these might include:

  • local
  • development
  • staging
  • production

Each serves a purpose, but your setup should reflect your company’s needs. If you’re a small operation, you might need just production (your live site) and staging (where you test things out before taking your changes to production). We recommend having these two at the very least.

With more than one environment, when installing plugins and such, you can see how things will work before the changes go live. This is much better than making changes directly to your production site—if you introduce problems, you could accidentally cause your website to go offline, lose data, and more.

Changing hosts

Sometimes you just need a faster server. While this won’t always fix your problem, adding additional processing power or memory to your web server could accomplish the following:

  • Speeding up your website
  • Allowing your website to handle more traffic
  • Supporting processor-hungry plugins

When choosing a new host, you’ll have to choose between shared and dedicated hosting. With shared hosting, you share server space with other websites and don’t get to upgrade things on the server. If you go dedicated, you’ll have much more control over your hosting, but it’s more technically complicated (Gravitate can help with this).

Consider as well the level of support you need from your web host. Some companies set up your hosting account, give you the keys, and let you wade your way through support tickets and FAQ articles. Others offer live and after-hours support. Just be sure you choose a reputable company and speak to someone to make sure they’ll have your interests in mind.

We suggest reviewing these 3 important maintenance items when making your hosting decisions.

Say “yes” to caching

Most people are aware that caching can speed up a website. Not only does caching make your pages load extremely fast, but it improves your site’s functionality—to the delight of your visitors. Your SEO scores will probably improve, and you’re likely to experience increased conversions, directly contributing to your bottom line.

There are many WordPress plugins that properly handle caching, but we tend to stick with W3 Total Cache for our needs. Other popular options include:

  • WP Rocket
  • WP Super Cache
  • WP Fastest Cache
  • ZenCache

Consider the scripts that you’re including into your website

Large scripts can cause slower page loads and visual performance issues. Certain ad networks give you code to put in so that their ads will display on your site. The problem with this is that these scripts are often bloated and slow your page down, so be careful not to overdo it with third-party scripts.

Sometimes you can’t avoid them, though. If you are going to load them, consider deferring your Javascript so it happens at a later time.

Consider deferring your Javascript

Deferring the Javascript in your website will delay the loading of any script inside this wrapper. By adding this wrapper, you’re enabling the bare essentials (the basic “nice state” of your website) to load quickly and efficiently. What we want is for the initial page load to be sufficient for what the visitor needs to see, but when it’s done…in comes the Javascript and other rich behavior on your website.

How to defer your javascript code

document.addEventListener(‘DOMContentLoaded’, function() {
// your code here
});

How to defer your jQuery code

document.addEventListener(‘DOMContentLoaded’, function() {
(function($) {

// your code here

})( jQuery );
});

Don’t cut corners

When fixing performance and other issues, it’s important to not cut corners in your work. A javascript snippet that you found online may look tempting—just drop in some new code!—but if the solution is several years old or doesn’t seem to have much discussion around it, you might want to steer clear. Please be mindful of what you use in your site. Research whether it’s the right choice for the overall system that is your fantastic website.

Don’t over-optimize

Too much of a good thing can be a bad thing, and over-optimizing your website is no exception. There are many tips and tricks we can work countless hours on, but you may reach a point where there doesn’t seem to be much else to do. Maybe you’re trying to implement a solution that just creates other problems that your site didn’t have before.

When optimizing your website, be thoughtful about what you’re doing so your “fixes” don’t introduce new issues.

If you’re not sure what to do, don’t do it

While there are many optimizations for WordPress that you can perform yourself, sometimes you’re just in over your head. That’s OK—this is where we enter the picture. If you have performance issues with your WordPress website and want results, let us see how we can help. Chances are, if it involves WordPress, we’ve run into it already and have a solution for you.

Hire Gravitate. Get Results.