 David Greenwald, how to clean the WordPress database. David Greenwald used to be a professional music critic, and has interviewed Radiohead, Barth Brooks, and 50 Cent. Now I'm super excited about making WordPress run tens of milliseconds faster and keeping websites about 50 Cent for progression. He's a freelance WordPress developer, a performance engineer, and four-literate. Thank you. Let's give him a round of applause. Can everybody hear me again? Great. Thanks for coming. This is how to clean up WordPress database. I'm going to run this on my phone with magic. I'm not checking my Twitter. Don't worry. Okay. Too far. Okay. So I'm David Greenwald. Like he said, I'm from Portland, Oregon. You can check me out at DavidGreenwald.com or on GitHub. You're actually going to want to go take a look at that because I have some code examples that you can take home. You can see the things you can bring home to your database and run your own detective work. So here is a link to that, actually. If you want to check that out. And we're going to run through some examples, but this is a full list. So there's that link. These slides will be up online as well. So this is Passion of the Wife. This is a music blog run by my friend Jeff down in LA. This is a great site. He's been doing it for many years. He had a lot of readers. I think he gets about 100,000 unique visitors per month, something like that. So pretty good traffic. Not quite enough to break the internet. This was originally a Kim Kardashian photo, which we took out for copyright reasons, so this has to be imagined. But so with, you know, a few thousand visitors a day, most websites should be able to handle that. Jeff should not have been having any problems with this site. Instead, this site was crashing almost every day, and it was going on for years. This was a constant problem. So here's some of the things that he tried to do. He switched from this cheap share host to a faster BPS server. Not great. He thought he was being hacked. So he set up Cloudflare, set up DDoS protection and all that good stuff. Not super helpful. And he finally thought, oh, maybe it's the database. I don't know what that is, but I'm a music blogger, so I can feel that. And so he set up the WP Optimize plug-in and tried to think of the database. And this continued to not get great results. So eventually, I got in touch with Jeff and took a look at it, and we found out it was the database. And the issue was, his database was full of trash. It was full of junk all left over from a Facebook share counter plug-in that he believed it in, like, 2013. And it had just left all of its stuff behind in his database for years. So before I cleaned it up, I had about 252 megabytes of stuff sitting in the options table of this database, and we'll talk about what that is, after two megabytes. So that's a lot better, obviously. And here's why this matters. So the options table saves all the settings for your WordPress site through plug-ins and for WordPress 4 as well. And so if you part of that are things that autoload, they load automatically with every page view, so that anyone coming to your site gets all the right settings. Some things only load conditionally when they're needed to, but a lot of stuff that's in this table is automatically loading. So every time someone is coming to a page of Jeff's site, they're getting all this data, there's 252 megabytes of data. So what would happen was, he would tweet a link to his site, five people would look at it, and it would overload his server, which had one gigabyte of ground. So that's not really the position that you want to be in where you can't have six people on your website. So what we can learn from Jeff's story is that database problems are sneaky. They're not the first thing that people are looking for. They're expensive. You're probably wanting to upgrade your server or your hosting because you think that's the real problem, which it cannot be. And it's bad for business and traffic because if your site is crashing, if it's slow, these are things that hurt you in Google results and they hurt you with your customers. So this is a problem that you can solve for your clients. It's going to be a big win for them financially and for you financially. So what is the WordPress database? Raise your hand if you think you sort of know what it does. That's great. That's awesome. That was better than the Portland Talk box. So all your WordPress content lives in the database. Basically, what happens is someone comes to your website. There was a great discussion of this in Zach's caching conference yesterday. He caught that. But somebody comes to your website and WordPress goes and talks to the database. He says, I need the information that goes on his blog post. The database says, here you go. WordPress feeds that into your theme and then it makes an HTML page to serve out to your visitor. So it basically looks like this. The docs WordPress. The ping is minus 2L and that tennis ball is your blog mode. So we need the doc to get the tennis ball to bring it back to you as a visitor to his website. So database queries, which is a search for this information, they take time and then they use data which fills up your RAM, fills up your server's memory. So we want to really optimize both of these. We want things to run fast. We want them to use as little data as possible so we can have lots of people come to our site and not crash on six people. So what is a database? Just to scale out a little bit. A database, every WordPress website has a database. They organize their data in tables. And those tables are basically, you can think of it as a spreadsheet. It's storing information in rows and columns. So the way that's set up in WordPress is your rows are for each individual item. So blog post one, blog post two, blog post three. Each one of those will be a row in your database. And then you have columns that break up those rows so you would have your post title, your post content, your post excerpt. So this is how the database organizes things. And here is what WordPress comes with. It's a whole bunch of tables. I'm just going to talk about a few. Posts, comments, users, those are pretty self-explanatory. Terms is where your categories and your tags live. Options, like we said, is where your settings are. All the settings across the site. And plugins like to dump a lot of things in there. Page builder tools that might come with your theme. We'll put a lot of stuff in there. And also, temporary data called transients can also live in that options table. So that's really the most important for performance and where we really want to look. The meta tables. Most tables come with a meta table. And what that means is if you're running advanced custom fields, if you're running a social media plugin, anything that would add new columns to your post table, instead of going into posts, that extra information goes into the meta table. So again, plugins that add extra information, that's all going to go into post meta. And those are the two tables that we are really looking for to see extra stuff generated in our database, so here are a couple of good database guides you can check out for a little bit more, deliciousbrains.com, premium.wpm.dev, if you want to get a little bit deeper on how this stuff works. So plugins also add their own tables. WorkVents is here this weekend. Thank you, WorkVents. We're from our sponsor. They add a bunch of tables to your database, so does Yoast, so does Reconverse. A lot of plugins you're probably using are adding tables to your database. They're really good because it means the information is organized, it's not sitting in your post meta table, so it's going to be better organized and a lot faster. But still, we have to make sure we're looking for bad actors and making sure that plugins are not adding extra data, bad data that we don't want on our side. So you might see, you notice that in our list of WordPress tables, they're all WP underscore. This is the default for WordPress. Your host might have to be different because it changes yourself, so that's what Reconverse is. So what actually causes database problems? A large number of rows and a large data size of the row content, like we saw with Jeff's site, where he has 250 megabytes of stuff. MySQL, the database software that we mostly all use, is really good at searching through thousands of rows. That is its job. So we can be less concerned with having a lot of rows and more concerned with the data. Let me show you how that works. If you have Pride and Prejudice in a blog post, that's going to be 700 kilobytes of information, whereas if you put my tweet in a blog post, that's .09. So if you have 5,000 blog posts and each one is Pride and Prejudice, we're going to have a much bigger database than if you had 5,000 tweets in your database. So we really want to be conscientious about the data that we're using. And another reason for that is not just performance, but also it's taking up room on your server, which you weren't paying for. If you have an account with a managed host like Flywheel or WP Engine, you are paying for every gigabyte of storage. It's not unlimited amount of space. And if you have somehow a database that balloons out to 250, 500 megabytes, you only have 5 gigabytes to use, that's something else to be aware of. Even if it's not causing a performance burden on your site, it's still taking up space. So we really want to be conscientious about that. So how can we tell if our database is slow? This is the fun part. So here's a couple tools that are very accessible. You can get more into New Relic and some other things that are high-end. But just to get started, these are great. ByteCheck.com, tools.bingdom.com, and GTmetrics. This is ByteCheck. And this gives you a measure of what's called Time to First Byte, which is how long it takes for someone to click on your website and for some other things to happen. And then for the work risk time to go talk to the database pig, get the tennis ball and bring it back to you and have the page ready to go. So we're looking for what's called the wait time, which is how long the server is doing that turnaround and actually getting the information to make the page. So in this example, 29 milliseconds, that's super good. You don't have a problem with this website. ByteCheck.com will give you more information. This is called the waterfall. This is a whole rundown of all the information, all the data that's floating on your web page. So the page itself and all your JavaScript, CSS. In that top bar, you can see it's broken into the steps of our Time to First Byte. And again, we want that yellow bar, the wait time. So we just want that little sliver to be really fast. So wait time is part of Time to First Byte. As you can see, they're in the waterfall. ByteCheck will break it out, but if you want to do more of a bigger speed test, you would use Bingdom or GT machines. So wait time should be, Google says it should be under 200 milliseconds. In real world scenarios, you can absolutely get it under 200. You can get it to 100. If you have, you're on a good server, you have a clean database. This is something you can very realistically shoot for. Something to remember is as your site scales and you have more traffic, that will put more strain on the server, more RAM or CPU, and so things will go slower. So you really want to make sure it is as fast as it can be before your server is under load and you're having a big traffic day, and all of a sudden you're going from 100 milliseconds to 300 to 500, so slow wait times can be caused by several factors. Your server, it can be old hardware, it might not be on a solid state drive, an old PHP version, a lot of us are still on 5.6 or 5.3, or who even knows, we should all be on 7.0 or better, or in a slow database. And so in Jeff's case, he had just moved over to a fast server, so we knew he was on, moved to Digital Ocean, so we knew he had a good server, he was on PHP 7.1, so no problems there. So when I was doing my speed test, you can do process of elimination, see, that slow wait time is probably because of the data space. So that's something to solve if you are on slower hosting, you definitely want to upgrade, it's not a lot of money, it's really worthwhile. And then you can do these tests and see if you think your database is going to be a problem. So caching is probably something that you have heard of, who's heard of caching? Raise your hands. If it's running on your website, that's great, you should absolutely do that. But caching is a band-aid for the database because what happens is the cache page is built from the database information, and then we skip right over it every single time after. So if you have a slow database and you're caching on, it's fine, you're never going to know until you do. So you always want to test with caching off, make sure you're really getting the correct results from the database and not from the cache. One more slide about that. Particularly, this is Zach's talk in one slide. Zach's talk from yesterday was great. Caching builds your HTML web pages once and then saves them for future use. So we don't have to talk about the database anymore. It makes wait time super fast because you are no longer doing that step. You're ready to go. But it is not a fix for dynamic pages and pages that have to be generated on the fly. So if you were a logged in user, if you were on the back end of your site, none of that's cached. If you have a site with thousands of pages that can't all be cached, I have one client who does have about 3,000 or 4,000 blog posts. And if you wanted to cache all of that, that's not something that would be very realistic. So if you do want to do some caching, if you're not using it, I like caching anywhere. I like WP Rocket. It's a great plugin. It's really easy to use. But again, this is not going to be a fix for all situations and we want to make sure we are testing our database and learning about it. And then for performance, we're going to be the opposite table because that's loading every time. The post meta table because that's where plugin data goes to die. And then also posts and comments can get out of hand. And of course, any plugin tables that get added really want to be policing. So here's some database detective tools that we can use to start getting into this. Some WordPress plugins we're going to look at. And also SQL. Ultimately, you have to write some code if you really want to get into advanced cleanup and do it yourself. No plugin can do it for you because you have to be the one to say, I think this is from this plugin that I don't use and I need to delete this specific thing. And let's find out how much information that that is using. And we're going to learn that today if we don't run out of time here. And you can also go on, you can do any of this in PHP My Admin. This is a MySQL tool that probably is on your server. It's certainly on a scene panel with a MySQL and you can do any of the same code. But you probably have PHP My Admin and you probably have another similar tool that you can use to interact with your database. You don't want to be doing this in the WordPress dashboard with a plugin because that leaves you really vulnerable to hacking and you want to be doing it with an outside tool. So before you do anything always backup your database because as soon as you delete something if you're not 100% sure what that's going to do you want to have your backup ready to go. I use WP MigrateDB. The plugin does have a pro version but works great free. It's super reliable. Just save your database, do something, save another copy, make sure you've got that database back up ready to go before you do anything. So here is a great tool called server status. This is a plugin that people are busy. And this can help us start to understand what is going on on our server if we don't have any information about it. I don't know if that's too small to see but it gives us some good information and as you can see here we have nine gigabytes of space on our server. We're only using 27 megabytes of our database so that's great. You might have a situation where you have a 2 gigabyte database and a 5 gigabyte server and that can tell you well it's time to clean the database we'll upgrade the server, get some more room so that's a great place to start just looking at the size of everything you can get your PHP version your MySQL version companies are rolling out 7.3 and 7.2 is supported by WordPress right now might not be supported by some of your older plugins but certainly most things should be ready for 7.0 at this time and you should be safe too after. So WP Optimize we talked a little bit about it doesn't solve every problem but it can solve some really easy ones that we can knock out. So when we look at this plugin this gives us basically some information about what they call rows and also the data size which is our megabytes that are being filled up by Facebook share counter plugins from 2013 that never got released. So this is a really great time to just use some common sense and say what are the biggest tables as far as rows, what are the biggest tables as far as data? I have 300 posts on my blog why do I have 30,000 rows in the post table or if you have an MP options table you really want that to be as small as possible it should just be one or two megabytes maybe about 500 rows WordPress comes with about 250 rows of built-in options and so once you start getting to 1,000 2,000, 5 megabytes, 10 megabytes 252 megabytes that's a time when you want to go in and really see what's going on. So we can use some common sense usually learn about our database to see what we need to start owning it up. So some things that the WP Optimize can do the first thing you want to do is clean your post revisions anytime you hit save or publish on a post or page in WordPress what that is doing is saving a version of that post which is awesome because with every version you've ever published on your site but if you have 5,000 Pride and Prejudice blog posts and you have 30 copies of each one you don't have a gigantic database so you should go in and clean every so often especially at an older site you really want to make sure you're cleaning that out and you don't have 5 years of drafts from your 5,000 blog posts that are all saved out that you don't need anymore you can clean out spam and trash comments that's a one-click thing that's great to do. One thing that this plugin does that you don't need to do anymore is clean out expired transients which is temporary data that can be generated by loop commerce sessions and things like that I might know actually through that F4 so we probably don't need to do that anymore and the other thing is checking the optimized database tables at the top and that will just empty the recycle bin basically and make sure you actually clean out your trash and you can get a clean database so this is spring cleaning basically you want to look in on this make sure you're doing it every so often but it's not going to solve advanced problems it's not going to delete old plugin data it does have a setting for orphan relationship data and orphan post meta data which means if you have a post it has some post meta data maybe somehow that post got deleted and it didn't delete its five rows of meta data so that's something you can clean out here but that's not going to be a major problem in general because WordPress does a good job of cleaning that stuff out and what this plugin cannot do is look at orphan data from its plugins so that's something that we have to do by hand which we're going to do in a couple of slides so advanced cleanup that humans have to do, I don't know if there are any advanced plugins which can do this so we're going to get into it right now we're going to look at the options table and post meta and of course plugins tables are also what we want to make sure we are keeping an eye on so what causes some problems bad actor plugins currently on your site which are just filling up your database you didn't even know abandoned data for old plugins that you haven't used since 2013 which are slowing your site to a crawl really want to make sure you get that stuff out and then another edge case I found is import data so if you brought your site over from Blogger in 2010 like I did I found all the stuff that was supposed to go into post which did also went into post meta so I had like an entire extra copy of my site sitting in post meta not a big deal but something that should be cleaned out that doesn't need to be in your database so a lot of these issues are for older sites if you have a site that's been around for a few years you have more older information older code from the WordPress was not as wonderful as it is now of course older plugins you probably used a lot of different plugins and deleted them so if you have a site that's two months old you're not going to have a lot of these problems if your client's site is five years, eight years old these are things that you really want to go through and be looking for so facts only most serious database issues are because of plugins so that's what we want to focus on if you're running 20 different plugins on your site your client has all this stuff that's been sitting there since 2012 they don't know what it is we really need to go on and see what's going on so some problem plugins to watch out for social media share counters anything that is saving data for every post on your site that's a whole one row on your database for every single post popular post counters same kind of thing they might be saving all the popular posts from every day for as long as you've been running the counters you might have five years of data sitting there WordFence keeps a live log of every IP address that hits your website as part of its security measures you don't need that live traffic on turn that off and you will not be writing to your database and storing all that extra information and then search program search plugins like relevancy that creates a database in your database so that you can have more stuff indexed and better search results that's really great but it also takes up a lot of space so I'm not saying not to use these things I'm saying make sure you're aware of what kind of load these plugins are having on your site maybe you do need to upgrade your server so you can use the plugins you want to and just be aware of what's going on in there so something really important to do is vet your plugins WordFence is a great example because what that does is you have to go all the way through the 5000 options and check a box that says please delete my database stuff all my information when you delete this plugin if you don't do it it leaves its tables in your database forever and that's something that you have to go in and turn on it is not a default so you really want to go through the options of your plugins make sure you are checking that box so it doesn't leave stuff behind you want to do a test delete and see if it doesn't have that option if it is going to take it stuff with it I think WP Optimize I'm pretty sure it doesn't actually clean up after itself and it will leave a couple of rows in your database which is hilarious because there's a clean up plugin I'm not 100% sure it still does that but it did before so these are plugins that you are going to be using on these sites for years so it's worth it to take 15 minutes put it on a test site make sure you know what it's doing and you give it a good examination before you actually give it to the client and get going on your site so let's do some actual painting our goals today our mission if you choose to accept it we want to get the options table under 500 rows if we can under 2 megabytes auto loading and then we want to drill down into any other big tables with SQL queries and find the jump database table find the jump plugin data and get rid of it so it's not taking out memory taking up space we can be using for faster results so this is an SQL query and we do have some time so we are going to try to teach you all a little bit of SQL this is written SQL before that's amazing I was expecting 0.7 so basically the magic of getting into your database is the second function here we have our select statements so we are going to do a search we are going to count everything as an auto load row count so we are going to count all the rows in the options table that are auto loading and then this big thing that takes up a bunch of lines here round sum, length and cap what we are doing in there is getting we are adding up all the data and then we are going to get that data for the rows that we are looking at so you can apply this function to any table in the database you just have to change the columns so in case the meta tables say the options table has option ID option name and a meta table would have a different list same for the post tables but all you have to do is put in your the column names of the table so you can get the total information the total megabyte data you can do our where auto load equals yes so we are going to run this slide we are going to switch over to the computer so I use MAC to do my local development that comes with phd myadmin any tool is going to give you a pretty similar setup but basically this is a database the client database as you can see it has 5 million tables in here from all the plugins that they have been using so this is a good way to get started you can say am I using rg the prefix is where you are going to get the information on what plugin this is and sometimes you have to do some googling but if you know what tables are supposed to be there already you can look in and say ect that is not something that goes before press oh I know that is an image plugin so you can look and see what are the extra tables that are getting added to your database and if you did your vetting you already know but if you see anything in here or you can back up your database and then you can just delete it and you save yourself that space so if this site was no longer using the EWWW plugin you can just check this box and go all the way down to the bottom keep scrolling all the way down and then with that selected table we can just hit drop and delete it and then it is gone so again, back it up before you start dropping tables you don't want to break anybody's budget so that is the first thing that we can do and we can also can you really see can you make this a little bigger we can see how many rows we have we can see what the size is so if we do the number of rows here we have 400,000 rows in post meta so there is a lot of plugin junk in there that we can probably get rid of and then we can see here top 10 daily top 10 is a plugin that this site is using and I happen to know that they have some settings to say cap the data at 30 days and then clear it out if you don't do that it stores it forever which is why we have 100,000 rows instead of 20,000 so you can look at this and start to see where the problems are you can look at the size and again this is where I really want to look so we have 68 megabytes of stuff in posts we have already cleaned out and for this particular site and other revisions are cleaned and you can't do a lot about this table you're post your content you can't have less content on your website so that's something you have to live with and we just have to clean everything out around it so let's do some code on this and see what's going on in here and I definitely do not have this all memorized so we're going to copy pay a little bit and then I'm going to explain what I'm doing so let's get a look here and so you would click the SQL tab so you can write actual code in here and so what we're going to do here is select account and this is going to be the name of your information so you know like this from the WP options table in this case they use a different prefix so we actually have to change our SQL here so when you take these home make sure you are matching it to the actual prefix on your site so we're just going to do iu j a k b o and we're going to look for anything that matches transient so if you use the light keyword in your query that means it's not going to do an exact match but it's going to look for a parcel match so that allows us to look for keywords for terms within our information so we'll go on that we have exactly one auto loading transient in the options table so this options table is clean that's great if you get 2,000 rows then it's time to go in and probably delete some of those and figure out what is generating those transients it's probably WooCommerce it's probably an old plugin so let's find something a little bit more interesting on the site let's go into the options table and see what's going on here so we can just hit browse here and a great way to get started is just to look at the database just put it out to a couple hundred rows and I know that the options table starts with about 250 rows so you can scroll down and see what's on the next page so here we have WPSCO site map and again we're looking at the prefix here in this option name so I know WPSCO that's not WordPress that's something to plug in at it you can keep going down and here we get ECPT that's from a plugin TubePress that sounds like a plugin also so again this is like where you have to do it yourself and Google is your friend trying to figure out what plugin and what data do I need it anymore this can't really be automated you have to go in and look at it and make some decisions and here is Pyre and I think that's from a page builder so let's check that out let's see what information we can get about Pyre so I'm going to go back to SQL around this query and we can just hit go so we have 45 rows from this Pyre plugin and so if we're not using that anymore and we want to delete them we can just switch that over from a select statement which is a search statement delete statement SQL and something to do first is always run the select first don't delete something without knowing what you're deleting so we did our search we know exactly what we're going to get rid of we can hit simulate make sure we're getting the right thing match rows 45 that's what we got in our previous test so that's great let's just delete it from this database why not do you really want to do it? sure we're ready to go we're going to get the 45 rows from our database so let's go into post meta because that is a little bit trickier and here this is where we have 400,000 rows and one thing we can do in here post meta gives you the meta key so in the options table every option is going to have different value because each one is one option whereas in post meta everyone is going to be a particular core value that goes on every post so if you have this underscore wp attached file which might be the picture the feature damage or something like that every post is going to have a meta key with wp attached file and the value will change so if you have 5000 posts you would have 5000 at this particular key so what we can do is see what are the top meta keys what meta keys are taking up space and that will tell us what plugins are causing us problems so we are going to use this gigantic statement over here so what we are doing here is we are doing a search of meta keys we are going to count them we are going to get a sum of all the data by using the column names all of them can be measured here we are going to group them by the meta keys we are going to get an order list we are going to order them by the size and the descending order and then we are going to limit that to 10 because otherwise it is going to give you when you are doing these kinds of searches to put in a limit so that your database is not just spinning over and over you can see with the top 5, top 10 that is where all your problems are going to be anyway you are not going to have 20 different things that are all causing a problem, we can hope usually it is one or two plugins that is going to be 80% of your problem and you can just get rid of them so let's see what information we get here that is bad so we got an error because let's get rid of that well this didn't work, this is the dangerous line you know what we can do is I have a pet code on my and we can grab that directly and I know that will work so this is the the GitHub repository, that's me sorry about that so you can go out here and get all the information that we are discussing down here to post meta and get this information and so we are going to go back up here into let's just go back up here into the database in SQL and again I am going to change the prefix from wp to and we will see what this gives us hopefully this one works so this is great because if you plug that in then you get a chart of what the biggest meta keys are so here we have wp attachment meta data the underscore wp that means it's WordPress wp attached file so we would expect to have a lot of information for those because WordPress makes that into every page but SEO smart cache that's from a plugin, that's something else same thing with radium post views count, radium is not WordPress, that's a plugin so what we can do here is say these are the top 10 things that are taking up space in our database, I know this is a plugin I am not using it anymore, I want to lead it so you can go ahead and get rid of radium clear those 14,000 rows and what you can do there is a really simple statement and you can just go back to SQL and hit just delete from the table where the meta key is that all you have to do, let's see so that's going to give us 14,000 like we saw before so we know we are leading the right thing this is safe to do yes we're sure please don't break our site and it will delete those 14,000 lines so this is basically what you want to do is you want to get your rank list and everything that's going on here and figure out what's from plugins I am not using anymore and same thing with the options table figure out what's the plug, what can I get rid of and that's basically how to clean up your options table and you can customize these queries and really get a lot of good information and that's the end of my talk and I can take some questions now we went from 0 to 60 on this talk so I hope you can all take away a really good theoretical basis for how this stuff works and then get a few applications this might not have a lot to do with your talk but with the MyISM and NodV tables what's your thinking of those going forward well, so I'm not an expert on it but WordPress does use NodV as the default WordPress, I think 4.4 on just in my NodV experience it is a little bit faster and it gives you some benefits as far as being able to back up with transactional stuff and have safer backups so yeah definitely using the more modern version and I think that's going to be the default on any new WordPress site you're setting up and generally it is pretty safe to convert if you're on MySQL 5.6 so as always take a backup and change all the tables make sure you just break anything so I would definitely go ahead and modernize that so I'm wondering about moving a site to be internationalized if you have something with the default encoding and you want to convert it to UTF-8 are there good commands you could use to can you do that with just SQL or do you have to do some custom PHP code plus SQL to convert your entire database no you can absolutely do it in SQL and you can switch from UTF-8 to UTF-8 M4 or whatever you want yeah it's just a command and I think you do have to go table by table because I just did this the other day it was a little bit aggravating you can actually just go in in MySQL here and you can go over to go into your table and hit operations and you can just switch that over in the storage engine bring in the collation and you can put that over into you know whichever one of these you want to use and then you just hit go and you're all done so you can just do it that way there is some codes to do it which I don't know and you can certainly just do it with a couple lines of code and just the thing to watch there that I've run into is if you have different versions of MySQL that you're moving between 5.5, 5.6 for instance 5.6 is not friendly with some of the new UTF-8 or 5.5 is not friendly with some of the M4 versions so just make sure you're saving everything everywhere make sure everything actually works in the right environment when you're moving things around and just go in there I was just wondering if you know of a good plugin or easy method for routinely dumping revisions like I have a site where there's a lot of editorial process that happens to publish but then when they're published revisions aren't really needed anymore so something that like just doesn't have a regular job or process just a good plugin for that or is that easiest to do with the WordPress schedule tasks in MySQL? Yeah, you know there's a couple ways to deal with that one is that you can set the amount of revisions in WP conflict so you can set it to zero and not have any you can set it to three that's one problem so that's one thing to just limit it from there as far as clearing it, I don't know if there is a plugin that automatically quizzes but what you could do is just write out the SQL to delete revisions and just run it like with a cron job every day or every week or whatever it is or you could go in with WP Optimize and just check that box and just do it once a week To delete the last week or the last two weeks for revisions also Okay, so that's great I think it's in like the advanced settings it's not, we just click the bottom on the home page and then they will delete all of them and you can set it to a week or two and then some of the other data is cleaning apps will do that or plugins will do that to let you set like how many days or how many, how many so it's a solve problem in a number of plugins Excellent, and you could write a query that just says look for stuff in the last, that's older than DateX and all that stuff But yeah, that's great, that's a excellent plugin to use anymore, I'll set Alright, good luck cleaning your databases Thanks everybody