Google和网站用户都喜欢快速的网站。网站(Site)速度是大多数主要搜索引擎的排名因素,用户希望网站能够在移动设备和 PC 设备上快速加载。缓慢的速度会影响您的网站转化率、用户体验和在Google中的排名,因此,提高网站速度只会对您有所帮助。
更快(Faster)的站点表明维护良好的设计和编码。它们还指示了CMS背后的数据库的状况——由于看不见而经常被忽视。
WordPress (WP) 将您的所有内容存储在您的数据库中,包括:
- 页面
- 评论
- 博客文章
- 主题设置
- 插件设置
- 投资组合项目
- 表单条目
- 链接
- 网站设置
如果您定期更新您的网站,您拥有 WP 网站的时间越长,它拥有的数据就越多,数据库就会越大。过(Overly)大的数据库会影响您网站的性能,并且需要更长的时间来为您的用户检索信息。
由于 WP 将您需要的所有内容存储在数据库中以及许多您不需要的内容,因此定期清理数据库至关重要。通过删除不必要的数据,您可以提高网站的效率。
备份您的网站(Back Up Your Site)
在对数据库进行任何操作之前,请确保备份您的网站。安全总比后悔好。
如果在清理数据库时出现问题,可以恢复完整的备份以修复在此过程中可能出现的任何问题。
使用 phpMyAdmin 优化您的表格(Optimize Your Tables Using phpMyAdmin)
phpMyAdmin 是一个免费的 Web 应用程序,也是管理 WP 数据库的常用方法。
它使您能够通过方便的图形用户界面(Graphical User Interface)( GUI )使用MySQL数据库管理系统。如果您的主机提供对 cPanel 的访问,您可以从数据库(Databases)下的 cPanel 访问您的 phpMyAdmin 工具。
从 phpMyAdmin 控制面板中,找到并单击与您要清理的 WP 网站相对应的数据库。
您现在可以从要优化和清理的站点访问所有数据表。如果您有多个数据库并且不知道哪个是正确的,请登录到您的 cPanel 并找到您的文件管理器来访问您的wp-config.php文件。
查看(Look)您要清理的网站的根文件夹。找到wp-config.php文件,右键单击它,然后选择编辑。(edit.)
查找DB_NAME以识别您正在处理的站点的数据库名称。确定数据库名称后,关闭File Manager和cPanel。
重新登录phpMyAdmin。滚动到表格列表的底部,查找并单击全选(select all)。
你会看到它说选择。(With selected.)单击优化表(Optimize table)。然后 phpMyAdmin 将自动运行碎片整理应用程序。
删除未使用的插件和主题(Delete Unused Plugins & Themes)
插件和主题在您的数据库中占用了大量空间。删除任何您不使用的内容是减小数据库大小的一种简单方法。
要搜索已安装的插件,请登录 WP 仪表板,将鼠标悬停在Plugins上,然后单击Installed Plugins。
WP 用户在选择要使用的设计之前经常测试许多主题。您(Did)是否删除了不使用的主题?
要检查,请转到您的 WP 仪表板并单击Appearance–>Themes以查看是否有多个。
即使停用的主题仍在您的数据库中占用空间。不是这种情况。您必须确保将其完全删除。
删除旧的过时帖子(Delete Old Outdated Posts)
如果您可以确定关于Internet的一件事是,事物会不断变化。
因此,如果您经营博客多年,很可能您的许多旧帖子不再相关或不准确。
不要只是开始删除过时的内容。您应该首先进行内容审核,并确保在删除该内容之前重定向该内容的URL 。(URLs)
您不想消除您可能拥有的任何传入链接。您还需要确保通过该链接访问您网站的任何人都被带到相关帖子,而不是“未找到 404 页面”消息。
保持您的网站更新(Keep Your Site Updated)
旧(Old)版本的WordPress、主题和插件可能会对您的网站及其相应的数据库造成严重破坏。问题(Problems)的范围从兼容性问题到可能减慢甚至破坏您的网站的安全漏洞。
一些 WP 设计者喜欢在更新版本的WordPress(WordPress)出现时等待一小段时间,以便解决所有问题。让其他人找到错误,这样您就不必这样做。
养成在新版本发布后立即更新WordPress、您的主题和所有插件的习惯。
使用 WordPress 插件(Use WordPress Plugins)
与大多数 WP 需求一样,有一个插件。WordPress提供了许多数据库清理插件来帮助您保持网站整洁。下面(Below)是一些比较流行和有用的。
选择插件时,您要确保它与您的 WP 版本兼容,仍在维护,并且最近已更新。
WP-优化(WP-Optimize)
WP-Optimize是清理数据库和提高 WP 性能的最强大和最有效的插件之一。它易于使用且适合移动设备使用。
它的一些功能包括:
- 对 MYSQL 表进行碎片整理。
- 无需手动运行查询即可优化数据库。
- 删除不必要的数据,如垃圾评论、pingbacks 和 trackbacks。
WP清理优化器(WP Clean Up Optimizer)
如果您想优化您的WordPress网站并清理数据库中不必要的数据,而无需使用 phpMyAdmin,那么WP Clean Up Optimizer就是您的理想之选。
这个插件清理的一些东西包括:
- 修订。
- 已删除的帖子。
- 待处理、垃圾邮件或垃圾箱中的评论。
- 自动草稿。
- Pingbacks 和引用。
- 重复的评论元。
- 未使用的术语。
- 重复的帖子元。
高级数据库清理器(Advanced Database Cleaner)
当您从 WP 仪表板删除旧页面或发布修订时,它会在数据库中留下一些不必要的文件。这些文件会降低您的网站速度。
Advanced Database Cleaner将找到这些文件,也称为孤立项目(orphaned items),以减少您的数据库大小并提高您的站点速度。它删除的一些孤儿是:
- 垃圾箱、垃圾邮件或待处理的评论。
- 帖子和页面的旧版本。
- 孤儿帖子元。
- 旧汽车草稿。
您还可以安排您的数据库自动优化和运行。
优化和清理 WordPress 数据库有助于提高网站的整体性能和速度。这将带来更好的用户体验和来自搜索引擎的更多流量。
如上所述,您可以做几件事来组织和整理数据库。对于技术含量较低的WordPress用户,使用 WP 插件比使用 phpMyAdmin 更容易。
How To Boost Performance In WordPress Through a Database Clean
Both Google and site users loνe a fast site. Sіte speed is a ranking factor for most major search engines and usеrs exрect а site to load quickly on both mobile and PC dеviсes. Slow speeds can impact уour site conversions, user experience and posіtion in Google and so, increаsing the ѕpeed of your website can only help you.
Faster sites are indicative of well-maintained design and coding. They are also indicative of the condition of the database behind your CMS – something that is often overlooked because it is unseen.
WordPress (WP) stores all your content in your database, including:
- Pages
- Comments
- Blog posts
- Theme settings
- Plugin settings
- Portfolio items
- Form entries
- Links
- Website settings
If you update your website regularly, the longer you have your WP site, the more data it will have and the larger the database will be. Overly large databases will affect how your site performs and take longer to retrieve the information for your users.
Since WP stores everything you need in your database AND many things you don’t, cleaning up your database regularly is essential. By removing unnecessary data, you can improve the efficiency of your website.
Back Up Your Site
Before you do anything to your database, make sure you do a backup of your website. It’s always better to be safe than sorry.
If something goes wrong while cleaning up your database, a complete backup can be restored to fix anything that might break during the process.
Optimize Your Tables Using phpMyAdmin
phpMyAdmin is a free web application and a common way to manage your WP database.
It enables you to work with the MySQL database management system via a convenient Graphical User Interface (GUI). If your hosting provides access to cPanel, you can access your phpMyAdmin tool from your cPanel under Databases.
From inside the phpMyAdmin control panel, find and click on the database that corresponds to the WP website you want to clean up.
You will now be able to access all the data tables from the site you want to optimize and clean up. If you have several databases and don’t know which one is the correct one, access your wp-config.php file by logging into your cPanel and locating your file manager.
Look inside the root folder for the website you want to clean up. Find the wp-config.php file, right-click on it and then select edit.
Look for DB_NAME to identify the name of the database for the site you are working on. Once you have determined the name of the database, close File Manager and cPanel.
Log back into phpMyAdmin. Scroll to the bottom of the table list and look for and click select all.
You will see that it says With selected. Click on Optimize table. phpMyAdmin will then run a defragmenting application automatically.
Delete Unused Plugins & Themes
Plugins and themes take up a lot of space in your database. Removing any you aren’t using is an easy way to reduce the size of your database.
To search your installed plugins, log into your WP dashboard, hover over Plugins and click Installed Plugins.
WP users often test many themes before they choose the design to use. Did you remove the themes you aren’t using?
To check, go to your WP dashboard and click on Appearance–>Themes to see if there is more than one.
Even deactivated themes are still taking up room in your database. This is not the case. You must make sure to delete it completely.
Delete Old Outdated Posts
If there is one thing you can be sure of regarding the Internet is that things change – constantly.
So if you have been running a blog for many years, it is highly possible that many of your older posts are no longer relevant or accurate.
Do not just start deleting outdated content. You should first do a content audit and make sure you redirect the URLs of that content before you delete it.
You do not want to be eliminating any incoming links you may have. You will also want to make sure anyone coming to your site through that link is taken to a related post not a “404 page not found” message.
Keep Your Site Updated
Old versions of WordPress, themes and plugins can wreak havoc on your website and its corresponding database. Problems range from compatibility issues to security holes that can slow down or even break your site.
Some WP designers like to wait for a short time when a newer version of WordPress comes out so that all the kinks are worked out. Let other people find the bugs so you don’t have to do it.
Make it a habit to update WordPress, your theme, and all your plugins soon after a new version is released.
Use WordPress Plugins
As with most WP needs, there’s a plugin for that. WordPress offers many database cleaning plugins to help you keep your site clean and uncluttered. Below are some of the more popular and helpful ones.
When choosing a plugin, you want to make sure it is compatible with your version of WP, is still maintained, and has been updated recently.
WP-Optimize
One of the most powerful and effective plugins to clean your database and boost your WP performance is WP-Optimize. It is easy-to-use and mobile-friendly.
Some of its features include:
- Defragmenting the MYSQL tables.
- Optimizing your database without having to run queries manually.
- Removing unnecessary data like spam comments, pingbacks, and trackbacks.
WP Clean Up Optimizer
If you want to optimize your WordPress site and also clean up unnecessary data from your database without having to use phpMyAdmin, WP Clean Up Optimizer is the plugin for you.
Some of the things cleaned up by this plugin include:
- Revisions.
- Deleted posts.
- Comments in pending, spam, or trash.
- Auto drafts.
- Pingbacks and trackbacks.
- Duplicated comment meta.
- Unused terms.
- Duplicated post meta.
Advanced Database Cleaner
When you delete old pages or post revisions from your WP dashboard, it leaves some unnecessary files in your database. These files slow down your site.
Advanced Database Cleaner will find those files, also called orphaned items to reduce your database size and improve your site speed. Some of the orphans it deletes are:
- Comments in trash, spam, or pending.
- Old revisions of posts and pages.
- Orphan post meta.
- Old auto drafts.
You can also schedule your database to optimize and run automatically.
Optimizing and cleaning up your WordPress database contributes to the overall performance and speed of your website.This will lead to a better user experience and more traffic from search engines.
As outlined above, there are several things you can do to organize and declutter your database. For the less technical WordPress users, it is easier to use WP plugins than to work with phpMyAdmin.