Podcast Episode

407 – Clean and Optimize Your WordPress Site

Announcements

  • Lots of Gutenberg posts

Is there a plugin for that?

With more than 50,000 plugins in the WordPress repository, it’s hard to find the perfect one. Each week, I will highlight an interesting plugin form the repository.

For more great plugins, download my 50 Most Useful Plugins eBook.

WP Health will check your WordPress installation to ensure that it is healthy, up to date, and secure. Use the WP Health page to quickly see the results of these checks using the simple color-coded sections.

Clean and Optimize Your WordPress Site

We need to occasionally (maybe 2-4 times per year) clean out some of the crud that’s stored in our WordPress sites.

Here are some suggestions on things to do for fall cleaning.

Thank You!

Thank you to those who use my affiliate links. As you know I make a small commission when someone uses my link and I want to say thank you to the following people. For all my recommended resources, go to my Resources Page

Full Transcript

Business Transcription is provided by GMR Transcription.

On today’s episode, we are going to talk about how to clean up and optimize your WordPress site right here on Your Website Engineer Podcast Episode No. 407.

Hello, and welcome to another episode of Your Website Engineer podcast. My name is Dustin Hartzler. I’m excited be here today because we are going to be talking about how to clean up and optimize our WordPress website. I’m always in the – I love cleaning up just and tidying things and being neat and organized. But I rarely do this with my websites.

And so, when I was transferring all of my content over to a brand-new machine, I got a new update from – or new updated computer from work. And I was like, “Wow, why is Your Website Engineer – the development site so large?” And I started going through and finding all kinds of things that I could clean up and optimize. So, that’s what we’re going to talk about today.

I do have some announcements. I’m gonna say announcements in quotation marks today because I don’t have anything specific. But if you scroll what’s happening on wptavern.com, you would think that Word or – you would think that Gutenberg is coming out tomorrow because we – we’ve got Drupal Gutenberg Project is talked about – we’re talking about Gutenberg is being rolled out to wordpress.com users. We’ve got Gutenberg 3.8 is released, adds full-screen mode. We’ve got an article about Yoast SEO 8.2 and how to – how they are adding Gutenberg blocks for structured data. They are – there’s another – there's a theme that’s talking about on there about the Gutenberg.

And so while I did some research and I tried to figure out when this Gutenberg thing is coming out. I couldn’t find anything. There is – there is nothing on the timeline. I did find that WordPress of 4.9.9 is looking to release in about a couple months. It looks like about November 5th is when they're targeting that – that release with a – a beta that’s supposed to come towards the end of October.

And so, those are some – just some things in the news. Nothing really specific other than just Gutenberg stuff. And there’s a bunch of – just a bunch of work getting to – getting to do that. It looks like probably we’re talking – we’re in September now – it’s probably going to be 2019 before we see that Gutenberg release or that 5.0. Unless Matt has – is planning on releasing it right after or right during WordCamp U.S. which is December 7th, 8th, and 9th in Nashville, Tennessee. And so, we’ll have to just keep an eye and an ear out for what’s happening with the Gutenberg.

Alright, moving on. I want to talk about a plug-in of the week. And this one is called WP Health. And it is formerly – it was formerly called My WP Health Check. And it basically will check your WordPress installation to ensure that you are clean and healthy and up-to-date and secure. You can use the WP Health to quickly see the results of these checks by using the simple color-coded sections within the dashboard. Once it’s installed, there’s a new WP Health page added to the tools and a heart icon in your admin bar if the results of these checks need attention.

So, it checks different things like WordPress version, MySQL version, PHP version, plug-in updates, inactive plug-ins, admin username, plug-ins no longer being supported, plug-ins with no invulnerability, theme updates, SSL, file editor, optional rest API integration. So, those are some things that you can see if you want to check this out. This is probably something that could go very well along with our conversation today about cleaning up our WordPress website. We could probably just add WP Health first to our site and run through it and make sure that all of those things are green. And then move on to the other items that we’re gonna talk about in the show.

So, let’s move right over there. Let’s talk about our complete guide, or it’s not the complete guide, but it is the complete Dustin’s guide of – of what he’s gonna do to clean up his website in the next week. And so, most people do spring cleaning. Some people like to do winter cleaning, whatever. I mean, it’s important to do several times a year to go through and clean your site periodically. It’s usually pretty lightweight when you first get started, but over time you need – you’re started to add a lot of files. You’re adding some images. You’re adding content. You add plug-ins. You remove plug-ins. You got new themes. You remove themes. And you maybe you even tweak some of the code in core files.

And so, this causes your site to grow in size. It’s – the matter – this matters because if somebody needs to access your site, the site takes longer to perform – to perform those crucial functions. It – it takes longer for it to load when customers or users are coming to your website. It takes more server space when you are trying to back up your website or store it somewhere on the cloud. It just makes – makes it more difficult if there’s stuff in there that you’re just not using anymore and just needs to be cleaned.

So, let’s spend some time talking about how to clean our sites. We’re gonna clear out some of the unnecessary data, the content, optimize our images on – on the server. And we can do pretty much everything on your current server. Now, most people say how to – how to speed up your website is to get a good web server. Well, we’re not gonna talk about that today. We’re gonna talk about what we can do with the – the current configuration of our site right now.

So, the first one – and I – I think I talk about this about every time that – that we have this kind of conversation, this discussion. But the first thing is, get rid of unneeded themes and plug-ins. They’re excellent resources. They’re great to have. They’re good things to troubleshoot. You know, a lot of times, the first step that we say when we say when troubleshooting a theme is to switch to a 2017, 2016 theme and see if the issue happens there. Then, if it doesn’t, then we know that the issue’s in your theme. Well, it’s very simple and easy to download those themes when you need them, so there’s no reason to keep them around when you don’t.

And the same thing is for plug-ins. If you try it, and you don’t like it, let’s go ahead and remove it and let’s get rid of it because you just have to keep it updated and it, again, takes up – takes up space on your server. And it’s just extra clutter to, “Oh, I need to de-activate all of my plug-ins. And, oh, when I turn them on, I have these 70 plug-ins that I wasn’t using.” And that gets to be a little bit of a – a mental – a mental roadblock if you will. So, the first thing is, let’s get rid of unneeded themes and plug-ins.

Next, we want to make sure that everything is updated. We talk about this regularly. We want to go in and make sure that WordPress is updated. We want to make sure our themes and our plug-ins are updated. And everything is good-to-go. This helps us not only keep things secure, but it helps us keep things fast. Every new version that comes out with WordPress is always a performance improvement it looks like. And then most of the time, it’s the same things with themes and plug-ins as well. It makes sure that things are moving smoothly on your site.

The next one is to get rid of old post revisions. So, there’s no real easy way to do this. By default, you can use a plug-in. It’s called Optimize Database After Deleting Revisions. It’s kind of a funky name, but it allows you decide exactly which revisions to keep and which ones to discard. The reason for this is it just clutters up your site.

What happens is when – when you use WordPress, and you start creating a post or a page, it’s automatically gonna save or when you hit the Save button, it’s gonna create a revision. And the revisions are really cool, and there’s a feature in the right-hand side under – around the Publish button is you can go back and you can see previous revisions. So, in case you deleted text, or somebody else deleted text on your site, you can get them back. And – but you don’t need all of them. I know that I have revisions from my About page from years and years ago. That doesn’t need to be on my site anymore. Let’s just go ahead and just get rid of those.

There are – there’s a plug-in out there called Revision Control which allows you to limit how many revisions are saved, maybe two revisions or three revisions. Or you can – there’s a line of code you can add to your wp-config.php file that will allow you to set the same thing as well if you do not want a plug-in doing that. So, that is No. 3. Get rid of those old post revisions.

No. 4 is delete media files that aren’t being used. There’s tons of stuff that we add to our media library. Maybe we upload an image, and then we look at it in the preview, and it – it doesn’t look good. And so, we want to get rid of it. They take up a lot of space. It – it takes a problem. You know, that’s probably where the bulk of our size for our website comes through. So, you can go through your WordPress media library and delete unused images. It’s a time-consuming process. There’s not a real easy way to do this.

There is a plug-in called Media Cleaner. It’s a tool that simplifies the clean-up tasks for you by automatically clearing out media files that aren’t used in any content. It will move them to a temporary trash folder, and then you can approve each deletion. And so, that’s – that’s kinda how to get rid of or fix all the issues that are there on your site. But if you want to prevent – if you don’t want to have to do this regularly, then make sure that every time you add an image, you’re actually using it on a post or a page. And if you’re not, let’s go ahead and remove them immediately from the media library to keep things nice and clean.

Optimizing your images – that’s one of the big, big, big things that we can do to keep our websites clean and making sure that they are small and running quickly. And there’s different plug-ins out there. The Jetpack Image CDN does this. The EWWW Image Optimizer is a plug-in that optimizes your images. There’s a plug-in called Compress It JPEG and PNG Images, Smush Image Compression and Optimization.

All of these are in the show notes for Episode No. 407. But what these do is, it allows you to go in, and it will scan through your media library and remove pixels from your comp – from your pictures that aren’t needed. I mean, there – it’s a lost list. And it doesn’t – it doesn’t affect the image whatsoever, but it will save half the size of your WordPress site. So, that’s something that you can do to – to optimize your website.

Another thing you want to do is, you want to fix broken links. I use the Broken Link Checker. This tool allows – alerts you to automatic – or to – it alerts you when there are links that are no longer working. And this happens when – if people leave links in comments or if they are – you know, if you’ve – you’ve recommended something in the past. But 400 episodes have gone by, and now that item is no longer online. It – it allows you to do all of those things.

And so, the Broken Link Checker can go through and you can – you might have just a couple or you might have thousands that you can go through. And you can automatically from the Broken – Broken Link Checker tool, you can go in, and you can fix the link. Maybe it’s just a new – there’s a typo and you didn’t put https. Or, you know, whatever it may be, you can go in and you can fix it, or you can just remove the link, and it will just keep the text on your site and it won’t be linked anymore.

Another area that’s overlooked a lot when it comes to keeping clean and organized is your users. And whether that be removing unneeded users from your accounts or from your WordPress site or just updating their information. Maybe their e-mail address has changed, or they’re constant – you know, their – their name has changed or whatever. Just – it allows things to – it just makes it cleaner and more organized and the outdated information could lead to confusion. So, that’s something to look out.

Have you submitted a support ticket somewhere and created a user account for say, WooCommerce, for them to log in, and now you’re done with that issue? Now, let’s go make sure that that user account has been revoked.

Another one that I’m gonna spend some time on because this is where I know I have a lot of bloat on yourwebsiteengineer.com is to clean up the database. There is an – it’s possible to do it manually. There’s a – there’s a tool called WP-Optimize that will clear out your database, but keep it running lean in the future. Or you can go in and just remove the tables for plug-ins that you don’t use anymore. I know that I don’t use Gravity Forms anymore, and so all of the tables that are associated with Gravity Forms are still on my website. And so, I could go ahead and remove those and have no ill, lasting effects to my website. So, clean up your database.

And there are a couple different tools that are out there that you can do that. But there – it’s fairly simple, and usually, you can just click a button and it goes through and does some cool things. You can disable some assets from loading on unnecessary pages. This is a – a plug-in called WP Asset Cleanup, and it scans each page individually determining what assets are loaded and lets you decide on which ones to disable. It basically – it – it just kind of cleans up and helps those pages load much, much quicker for your users or your customers coming to your website.

You want to also eliminate unused tags, or maybe shuffle around tags or comments. These are ones that we probably might’ve created a whole bunch of them, and now maybe there’s only one category – or there’s a category with only one or two posts in. Maybe – does it make sense to keep that category or should we remove it? And just kind of work through – looking at the tags and the categories that they have a big zero in the count section. And if that’s the case, we can remove those because those are just adding more lines to the – our WordPress database and just slowing things down as well.

We need to take action on our spam comments because if we don’t – if we don’t take action, again, those are just more lines in the database. They’re just more – more pieces of information that your website has to load every time a page loads or a post loads depending on if those comments are on those pages. And so, there’s a – there’s a few tools that you can use that. You can use Akismet is a spam-fighting plug-in which helps to create or get rid of some of these spam comments.

We also have a plug-in called Spam Comments Cleaner and will allow you to automate the process so you don’t have to keep repeating this task. If you have a thousand of them, you can only select about 20-50 of them at a time and process and delete those through the WordPress dashboard before your server usually crashes because it takes too much – too many resources to – to do those. So, that’s something you want to deal with and work through is with the Spam Comments Cleaner.

So, make sure that there – there – there’s no spam comments in there. And – and honestly, if you’re not getting a lot of comments, maybe you just turn comments off for your – for your site. So, that would be a – a good way to kind of clean up and optimize your website as well.

I also think you should conduct a thorough content review. And this is gonna be something that’s very tedious. But once your – you kinda work through all these other things. Let’s say, we want to work through and talk about things – you know, we've already fixed broken images, and we've fixed optimizing images. But we want to see if – if there’s any content that’s on our website that’s out of date. Maybe the About page needs to be updated, the Contact page if you’ve moved locations or changed phone numbers if there's poor-quality content that's better off removed or replaced, content that’s too similar.

Maybe you have two posts that are very, very identical, or close to the same subject matters. You might want to just keep one of the best ones. So, it’ll take some time. Maybe you set a time, and you say, “Oh, I’m gonna go through five posts a day for the next two weeks.” Or whatever that looks like. Just spend some time going through or even like the pages – I know the pages section. I have a bunch of them that I no longer need. And that’s something that I need to go through and optimize as well on yourwebsiteengineer.com.

So, those are the – those are the ones that kind of came to mind. There’s a few more here that I think would be – that would be good. But we talked about this one a few weeks ago, and it was about hiding short – hiding unused shortcodes. So, there’s a plug-in to do that. But the best – the best case is to – as you're doing that site audit, and you can hide them right away.

Let – let’s put it that way. Hide all the shortcodes right away because something might be broken with the plug-in. And then as you're doing your site content audit, and you're going through each piece on your site, then what I would recommend doing is, “Oh, I found – here’s a shortcode that’s in there. Let’s go ahead and remove it.” And that gets rid of that content or gets rid of that shortcode inside the post already. So, that’s something else to think about.

You can also do a – what’s called an HTML Cleanup. And these are for – that’s basically advice for somebody that knows a little bit of HTML. But there is a – there's a way to specify all the HTML you want to be removed from posts and pages. So, if you wanted to clean up a certain bit of code. Maybe you have a – a spam tag that’s specify – specifying a color. Or maybe you have H3 tags around that you don’t want to get rid of.

You can use HTML Cleanup or another plug-in called Clean HTML. It'll put a visual button on your site that will help to strip out – gets rid of nonessential HTML which is really cool. So, if you do a Copy and Paste from another website, but there’s a lot of HTML that’s not needed, it will go ahead and clean that up which I think is really, really cool.

Another thing that you can do – this will help more with the speed load than your website size. It’s something called Clean Up Your Header. And there's a plug-in called WP Header Cleanup that will allow you to get rid of some of the sections or some of the – the things that are loading in the header of each and every page that loads on your website. So, it’s gonna get rid of the WordPress generator tag, remove standard feed lengths, the extra feeds. There’s a bunch of checkboxes that you can select in there, so you can remove and get rid of in the header section.

And that’s – those are some things. I think that would keep you busy for a while. I know that it’s going to be a – kinda a big project for me in the next week. I’m trying to work on that, and I’m trying to get my iTunes images in the podcast app, the Apple Podcast app. Those are the two big things that I'm gonna be working on this week to see if I can get both of those things working, and get both of those things up and just moving. I guess I don’t have to get my site working – it’s already working. But I want to get that clean and optimized. And I want to see if I can get the – and fix that podcast image artwork, and see if I can make it appear in the Apple iTunes Podcast player.

That’s what I'm gonna be working on this week. What are you gonna be working on this week? Was there something that you’ve just overlooked when it comes to keeping and maintaining your website? If so, you can leave a comment in the show notes for Episode No. 407. Alright, that’s a wrap. Have fun this week at cleaning up your website, and we’ll talk again soon.

    • Chad Warner Reply

      Dustin, thanks for covering this topic! I love getting things clean and organized, just like you said you do. It’s always a good feeling to take a WordPress site from messy to neat. I shared similar advice and tools in my WordCamp Greenville talk about WordPress maintenance. Thanks again for raising awareness about this!

      Sep 19, 2018
    • Prescott Perez-Fox Reply

      Definitely gonna try some of these — I just got my site back after a hack, moved to a more reputable WordPress-focused host, and I’d love to give it a once-over in terms of speed as well.

      Oct 29, 2018

Leave a Reply