解决WordPress错误的新手指南(逐步介绍)

Are you encountering a common WordPress error on your site? Do you want to troubleshoot these WordPress errors on your own? Most of these errors can be solved by following easy troubleshooting steps. In this beginner’s guide, we will show you how to troubleshoot WordPress errors one step at a time.

您是否在网站上遇到常见的WordPress错误 ? 您是否想自行解决这些WordPress错误? 通过执行简单的故障排除步骤可以解决大多数这些错误。 在此初学者指南中,我们将向您展示如何一次一步地解决WordPress错误。

Troubleshooting WordPress errors
1.创建您的WordPress网站的完整备份 (1. Create a Complete Backup of Your WordPress Site)

First thing you should do is to create a complete backup of your WordPress site. If you were already using a WordPress backup plugin, then make sure that you have a recent backup safely stored somewhere.

您应该做的第一件事是创建WordPress网站完整备份 。 如果您已经在使用WordPress备份插件 ,请确保已将最近备份安全地存储在某处。

If you were not using a backup plugin, then you should start using one immediately. However, in case you don’t have access to the admin area of your WordPress site, then you will need to manually backup your database and files.

如果您没有使用备份插件,则应立即开始使用。 但是,如果您无权访问WordPress网站的管理区域,则需要手动备份数据库和文件。

Backups allow you to restore your WordPress site easily when something goes wrong. They are your first and most important defence against security threats, hacking, and data loss.

备份可让您在出现问题时轻松地还原WordPress网站。 它们是您针对安全威胁,黑客攻击和数据丢失的首要也是最重要的防御措施。

2.清除浏览器缓存 (2. Clear Browser Cache)

A lot of times, your browser may not realize that a WordPress page or post has changed and will load it from the browser cache. This will cause you to view an older version of that page or post.

很多时候,您的浏览器可能没有意识到WordPress页面或帖子已更改,并将从浏览器缓存中加载它。 这将导致您查看该页面或帖子的较旧版本。

You may need to clear your browser cache to ensure that you are seeing the latest version of a page. We have detailed guide which will show you how to clear browser cache in all major browsers.

您可能需要清除浏览器缓存,以确保您正在查看页面的最新版本。 我们有详细的指南,将向您展示如何清除所有主要浏览器中的浏览器缓存

3.清除您的WordPress缓存 (3. Clear Your WordPress Cache)

If you are using a WordPress caching plugin like WP Rocket, then you may be seeing a cached version of your website. Some top WordPress hosting companies like Bluehost and Siteground also implement their own caching to improve performance.

如果您正在使用WP Rocket之类的WordPress缓存插件 ,那么您可能会看到网站的缓存版本。 一些顶级的WordPress托管公司(例如BluehostSiteground)也实现了自己的缓存以提高性能。

You need to clear your WordPress cache to make sure that your website is not serving a cached version.

您需要清除WordPress缓存以确保您的网站未提供缓存版本。

4.停用网站上安装的所有插件 (4. Deactivate All Plugins Installed on Your Website)

Most of the times errors are caused by a plugins conflicting with each other, your theme, or the WordPress core. Deactivating all WordPress plugins on your site will most likely solve the problem. You can then find out which plugin was causing the issue by activating plugins one by one on your site.

大多数情况下,错误是由插件,主题或WordPress核心相互冲突引起的。 停用网站上的所有WordPress插件最有可能解决该问题。 然后,您可以通过在站点上一个个激活插件来找出哪个插件导致了问题。

If you have access to the admin area of your WordPress site, then simply head over to the plugins page.

如果您有权访问WordPress网站的管理区域,则只需转到插件页面即可。

Select and deactivate all plugins in WordPress

First, you need to select all plugins, and then select ‘Deactivate’ from ‘Bulk Actions’ drop down menu. Click on the Apply button to deactivate all selected plugins.

首先,您需要选择所有插件,然后从“批量操作”下拉菜单中选择“停用”。 单击“应用”按钮以停用所有选定的插件。

If you do not have access to the admin area, then you will need to use FTP or phpMyAdmin to deactivate all plugins.

如果您无权访问管理区域,则需要使用FTP或phpMyAdmin停用所有插件。

Simply connect to your website using an FTP client. If you haven’t used FTP before, then you may want to see our how to use FTP to upload files to WordPress.

只需使用FTP客户端连接到您的网站。 如果您以前从未使用过FTP,那么您可能想看看我们如何使用FTP将文件上传到WordPress

Navigate to the wp-content folder and rename plugins folder to “plugin.deactivate”.

导航到wp-content文件夹,并将plugins文件夹重命名为“ plugin.deactivate”。

Rename plugins folder using FTP

For more detailed instructions, see our article on how to deactivate all plugins when not able to access wp-admin.

有关更多详细说明,请参阅我们的文章,其中介绍了在无法访问wp-admin时如何停用所有插件

5.切换到默认的WordPress主题 (5. Switch to a Default WordPress Theme)

Sometimes your WordPress theme can cause issues on your site. You can easily find out if your theme is causing an issue by switching to a default WordPress theme like Twenty Nineteen or Twenty Twenty.

有时,您的WordPress主题可能会在您的网站上引起问题。 您可以通过切换到默认的WordPress主题(例如“二十十九”或“二十二十”)轻松确定您的主题是否引起了问题。

Head over to Appearance » Themes page and then click on the Activate button next to a default theme.

转到外观»主题页面,然后单击默认主题旁边的激活按钮。

Switch to a default WordPress theme

However, if you don’t have access to the admin area of your WordPress site, then you will need to use FTP to switch theme.

但是,如果您无权访问WordPress网站的管理区域,则需要使用FTP切换主题。

Connect to your website using an FTP client and then navigate to /wp-content/themes/ folder. Download your current active theme as a backup to your Desktop.

使用FTP客户端连接到您的网站,然后导航到/ wp-content / themes /文件夹。 将当前活动主题下载为桌面的备份。

After that, you need to delete all themes except a default WordPress theme like TwentySixteen. Since your active theme will no longer be available, WordPress will now automatically switch to using the default theme available.

之后,您需要删除除默认的WordPress主题(如TwentySixteen)以外的所有主题。 由于您的活动主题将不再可用,因此WordPress现在将自动切换为使用可用的默认主题。

If your theme was causing the issue, then you should be able to log in to your WordPress site now.

如果您的主题是造成此问题的原因,那么您现在应该可以登录到WordPress网站。

6.刷新永久链接 (6. Refresh Permalinks)

WordPress uses SEO friendly URL structure or Permalinks. Sometimes the permalink structure is not updated or configured properly, which may result in unexpected 404 errors on your site.

WordPress使用SEO友好的URL结构或永久链接 。 有时,永久链接结构未正确更新或配置,这可能会导致您的网站出现意外的404错误

You can easily refresh permalinks without changing anything on your WordPress site. Visit Settings » Permalinks page and click on ‘Save Changes’ button without changing anything.

您可以轻松刷新永久链接,而无需更改WordPress网站上的任何内容。 访问设置»永久链接页面,然后单击“保存更改”按钮,而不进行任何更改。

Update permalinks in WordPress
7.备份和删除.htaccess文件 (7. Backup and Delete .htaccess File)

A corrupt .htaccess file is often the cause of the internal server error.

损坏的.htaccess文件通常是内部服务器错误的原因。

First, you need to connect to your website using an FTP client. The .htaccess file is located in your site’s root directory.

首先,您需要使用FTP客户端连接到您的网站。 .htaccess文件位于您站点的根目录中。

Since it is a hidden file, you may need to force your FTP client to show hidden files. See our article on why you can’t find .htaccess file on your WordPress site

由于它是隐藏文件,因此您可能需要强制FTP客户端显示隐藏文件。 请参阅我们的文章,了解为什么您无法在WordPress网站上找到.htaccess文件

You need to download the .htaccess file to your computer as a backup, and then delete it from your web server.

您需要将.htaccess文件作为备份下载到计算机上,然后将其从Web服务器中删除。

You can now try to login to your WordPress site and go to Settings » Permalinks page. Click on the Save Changes button to refresh your permalinks and to regenerate a new .htaccess file for your site.

现在,您可以尝试登录到WordPress网站,然后转到“设置”»“永久链接”页面。 单击“保存更改”按钮以刷新您的永久链接并为您的站点重新生成一个新的.htaccess文件。

8.修复WordPress网站网址 (8. Fix WordPress Site URL)

Having incorrect settings for WordPress URL and Site URL options can also cause redirect issues, 404 errors, and some other common issues.

WordPress URL和Site URL选项的设置不正确还会导致重定向问题404错误和一些其他常见问题。

WordPress URL and Site URL options can be changed from admin area by visiting Settings » General page.

可以通过访问设置»常规页面在管理区域中更改WordPress URL和站点URL选项。

Changing WordPress Address and Site Address options from admin area

Make sure that both URLs are exactly the same.

确保两个URL完全相同。

If you do not have access to the admin area of your WordPress site, then you can change these URLs using FTP. There are two ways to do that using FTP:

如果您无权访问WordPress网站的管理区域,则可以使用FTP更改这些URL。 有两种使用FTP的方法:

Update WordPress URL and Site URL Settings in wp-config.php File

在wp-config.php文件中更新WordPress URL和站点URL设置

Once connected to your website using an FTP client, locate wp-config.php file. Now you need to edit this file in a text editor like Notepad.

使用FTP客户端连接到您的网站后,找到wp-config.php文件。 现在,您需要在文本编辑器(如记事本)中编辑此文件。

Go to the line that says /* That's all, stop editing! Happy blogging. */, and just before it, add this code:

转到显示/* That's all, stop editing! Happy blogging. */的行, /* That's all, stop editing! Happy blogging. */ /* That's all, stop editing! Happy blogging. */ /* That's all, stop editing! Happy blogging. */ ,并在其之前添加以下代码:


define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Don’t forget to replace example.com with your own domain name. Now save your changes and upload the file back to your server.

不要忘记用您自己的域名替换example.com。 现在,保存您的更改并将文件上传回服务器。

Update URLs Using functions.php File

使用functions.php文件更新URL

You can also update URLs using your theme’s functions.php file.

您也可以使用主题的functions.php文件更新URL。

Open your FTP client and navigate to /wp-content/themes/ folder. Open your current active theme’s folder and locate functions.php file inside it. Now you will need to edit the functions.php file in a text editor like Notepad.

打开您的FTP客户端,然后导航到/ wp-content / themes /文件夹。 打开当前活动主题的文件夹,然后在其中找到functions.php文件。 现在,您需要在文本编辑器(如记事本)中编辑functions.php文件。

Simply add these lines at the bottom of the functions file:

只需在函数文件底部添加以下行:


update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );

Don’t forget to change WordPress URLs from the settings page after you login to your site. Once you have added them on the settings page, you need to delete these lines from your theme’s functions file.

登录网站后,请不要忘记从设置页面更改WordPress URL。 将它们添加到设置页面后,需要从主题的功能文件中删除这些行。

9.检查阅读设置 (9. Check Reading Settings)

If your newly created WordPress site is not indexed by search engines, then this is the first thing that you should do.

如果搜索引擎未为您新创建的WordPress网站建立索引,那么这是您应该做的第一件事。

Login to your WordPress site and go to Settings » Reading page. Scroll down to the bottom of the page and make sure that the box next to ‘Search Engine Visibility’ is unchecked.

登录到您的WordPress网站,然后转到“设置”»“阅读”页面。 向下滚动到页面底部,并确保未选中“搜索引擎可见性”旁边的框。

Search engine visibility

This option allows you to discourage search engines from showing your website in search. It is used by webmasters when they are working on a website that is not ready to be live. Sometimes you can accidentally check this setting and forget about it.

此选项使您不鼓励搜索引擎在搜索中显示您的网站。 网站管理员在尚未准备就绪的网站上工作时使用它。 有时您可能会不小心检查此设置而忘记了它。

Make sure that this option is unchecked when your website is ready to go live.

当您的网站准备就绪时,请确保未选中此选项。

10.对电子邮件问题进行故障排除 (10. Troubleshooting Email Issues)

Many WordPress hosting providers do not have mail settings properly configured. This stops you and your users to receive emails from WordPress.

许多WordPress托管服务提供商没有正确配置邮件设置。 这将阻止您和您的用户接收来自WordPress的电子邮件。

If you are using a contact form plugin, then you will not be able to receive those emails as well. You will also not receive any WordPress notifications.

如果您使用的是联系表单插件 ,那么您也将无法接收这些电子邮件。 您也不会收到任何WordPress通知。

See our complete step by step instructions in our article on how to fix WordPress not sending email issue.

请参阅文章中有关如何修复WordPress不发送电子邮件问题的完整分步说明。

11.扫描恶意软件和后门 (11. Scanning for Malware and Backdoors)

If you suspect that your WordPress site is affected with malware, then you should scan your website with Sucuri. It is the best website security monitoring service for WordPress site owners.

如果您怀疑WordPress网站受到恶意软件的影响,则应该使用Sucuri扫描您的网站。 这是针对WordPress网站所有者的最佳网站安全监视服务。

See our case study of how Sucuri helped us block 450,000 WordPress attacks in 3 months.

查看我们的案例研究, 了解Sucuri如何帮助我们在3个月内阻止450,000次WordPress攻击

For more detailed instructions, see our guide on how to scan your WordPress site for potentially malicious code.

有关更多详细说明,请参阅有关如何扫描WordPress网站以查找潜在恶意代码的指南

获得更好的支持 (Getting Better Support)

After following the above mentioned troubleshooting steps, you would be able to fix many of the most common WordPress errors. However, if the problem persists, then you can seek further support.

按照上述故障排除步骤进行操作后,您将能够修复许多最常见的WordPress错误。 但是,如果问题仍然存在,则可以寻求进一步的支持。

WordPress is a community software, so you can get help from the community by posting in WordPress support forums. Here is how to write a better support request:

WordPress是一个社区软件,因此您可以通过在WordPress支持论坛中发布来获得社区的帮助。 这是编写更好的支持请求的方法:

  • Be polite and nice. No matter how upset or frustrated you are, do not use harsh language.

    要有礼貌和友善。 无论您有多沮丧或沮丧,都不要使用苛刻的语言。
  • Mention your problem briefly.

    简要提及您的问题。
  • Describe troubleshooting steps you have taken so far.

    描述您到目前为止已采取的故障排除步骤。
  • Uplaod screenshots on a cloud image sharing service, and then add the links in your support thread.

    在云图像共享服务上升级屏幕截图,然后在支持线程中添加链接。

For more on this topic, take a look at our guide on how to properly ask for WordPress support and get it.

有关此主题的更多信息,请查看我们的指南, 了解如何正确地获取WordPress支持并获得

We hope this article helped you learn how to troubleshoot WordPress errors. You may also want to see our list of 14 most common WordPress errors and how to fix them.

我们希望本文能帮助您学习如何解决WordPress错误。 您可能还希望查看我们的14种最常见的WordPress错误列表以及如何修复它们

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值