About a month ago I was having space problems on my website. That is easily solved: by ordering the files, folders and images of FTP. Now, when that is not enough, we must start to review other aspects.
It is known that WordPress is a savage resource devourer and that if the hosting is not very good and it is good optimized, can bring difficulties over time.
MySQL data bases are a solid platform to use on websites, but if they are not maintained and errors are prevented, they can fail catastrophically . Sometimes maintenance is as easy as optimizing tables .
When we write a post, it is saved in the database. There will be saved waiting for someone to visit us: when someone enters the blog in WordPress a series of actions is triggered from PHP to be able to show us the information stored in MySQL .
If you are to modify your blog a lot, delete many comments, write many post, edit, delete post, install plugins that use the database, or use statistics plugins in your WordPress; surely after this you can save about 2Mb of space in the database, this is because 'optimize a database' eliminates the information that does not work and 'compresses' another. It is not only the fact of eliminating 2Mb of dead information, it is rather that that information bothers and can cause problems.
If you are someone who knows about this, you will say: this child speaks giladas. But I try to explain it easily, ok? Let's continue.
WordPress (as it was already said), it does not always erase all the information: if we delete a post, it will stop showing, but it may still be written in the database. So also with the comments. There are certain plugins that use the database (especially the forums, statistics, etc.) which sometimes are poorly optimized and can annoy; also when one deactivates or deletes them (using ftp), it must be taken into account that what was in the database was not deleted, it must be done manually.
Taking into account this model, we must know that: within each MySQL server databases (for users), within of each of them there are tables, in these the information is saved. A plugin can create several tables (for example: one for post, another for comments, etc.), and we can optimize or delete individual tables.
How can WordPress be optimized from the database?
First of all, it is necessary to do maintenance tasks in the blog: delete the queue of spam in Askimet, delete the comments that are to moderate (or approve them, as appropriate), delete post and pages, uninstall plugins, etc.
Once we did all of that, there are two paths; although before attempting either, is highly recommended to make a backup :
Manual Optimization from PHPMyAdmin : let's go to our PHPMyAdmin (or SQL server), I asked your hosting provider how to access the. Once there, we will select the corresponding database, and we will see a list of 'tables'. Let's go down everything and click on "select all". Then, we will look for the option 'optimize' (look at the drop-down menu).
This process may take several minutes, so it is not recommended that you close the browser and avoid losing the connection.
Easy option, is to use plugins:
: it's simple, easy and fast. It prevents us from doing the work by hand, it shows the size of each table and how much can be optimized. It works with a simple click
DB-Manager : optimizes and also has other functions such as backup, repair, etc.
I also recommend reading : special for WordPRess Mu (interesting) .?, Optimize MySQL for WordPress and a