wordpress注销_如何修复WordPress不断注销问题

wordpress注销

Have you ever encountered the frustrating problem where WordPress keeps logging you out? Recently one of our users encountered this issue. She followed all the normal troubleshooting tips like deactivating plugins, emptying cache, clearing browser cookies, and even restoring WordPress from backups. None of the above worked for her. If you’re facing this issue, then we have a solution for you. In this article, we will show you how to fix WordPress keeps logging out problem also known as WordPress session timeout issue.

您是否遇到过WordPress不断将您注销的令人沮丧的问题? 最近,我们的一位用户遇到了此问题。 她遵循了所有正常的故障排除技巧,例如停用插件 ,清空缓存,清除浏览器cookie甚至从备份还原WordPress 。 以上都不对她有用。 如果您遇到此问题,那么我们为您提供解决方案。 在本文中,我们将向您展示如何修复WordPress不断注销的问题,也称为WordPress会话超时问题。

为什么WordPress会继续注销? (Why WordPress Keeps Logging Out?)

In order to understand why WordPress keeps logging you out, you need to understand how the WordPress login process work.

为了了解WordPress为什么不断将您注销,您需要了解WordPress登录过程的工作方式。

WordPress sets a cookie in your browser to authenticate a login session. This cookie is set for the WordPress URL stored in your settings section. If you are accessing from a URL that does not match the one in your WordPress settings, then WordPress will not be able to authenticate your session.

WordPress在浏览器中设置一个cookie来验证登录会话。 此cookie是为存储在“设置”部分中的WordPress URL设置的。 如果您从与WordPress设置中的URL不匹配的URL访问,则WordPress将无法对您的会话进行身份验证。

Incorrect WordPress URL Settings

As you can see in the settings screenshot above, the WordPress URL and the Site Address are two different URLs (notice one has www. and the other doesn’t).

正如您在上面的设置屏幕截图中所看到的那样,WordPress URL和站点地址是两个不同的URL(请注意,其中一个具有www。,另一个没有)。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

解决登录问题 (Fixing The Login Issue)

A simple fix for this login issue is to make sure that you have the same URL in your Site Address and WordPress Address fields in your WordPress settings. This means that you need to choose either www or a non-www URL in the both fields.

解决此登录问题的简单方法是确保WordPress设置中的“站点地址”和“ WordPress地址”字段中的URL相同。 这意味着您需要在两个字段中选择www或非www URL。

Login to your WordPress dashboard and go to Settings » General.

登录到WordPress仪表板,然后转到“设置”»“常规”

Correct WordPress URL Settings

If you can’t access the admin area, then you can update these fields by editing the wp-config.php file.

如果您无法访问管理区域,则可以通过编辑wp-config.php文件来更新这些字段。

Connect to your website using an FTP client, and locate the wp-config.php file in your site’s root directory. You need to download this file to your Desktop and open it in a text editor like Notepad. Add this code just above the line That’s all, stop editing! Happy blogging.

使用FTP客户端连接到您的网站,然后在您网站的根目录中找到wp-config.php文件。 您需要将此文件下载到桌面上,并在文本编辑器(如记事本)中打开它。 在此行上方添加此代码。 那就停止编辑! 快乐的博客。


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

If you prefer to use www in URL, then use this code instead

如果您希望在网址中使用www,请改用此代码


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

Don’t forget to replace example.com with your own domain name.

不要忘记用您自己的域名替换example.com。

为什么此解决方案有效? (Why does this solution work?)

Technically speaking, www is a subdomain itself. This means that URLs with www and without it are actually two different domains.

从技术上讲,www本身就是一个子域。 这意味着带有www和不带有www的URL实际上是两个不同的域。

By changing and updating the URLs to the same address, it will fix the issue.

通过将URL更改和更新为相同的地址,可以解决此问题。

A more detailed technical explanation of www vs naked domain is here.

www与裸域的更详细的技术说明在这里

Also it’s important to note that incorrect settings in WordPress Address and Site Address fields may also result into too many redirect issue in WordPress.

同样要注意的是,WordPress地址和站点地址字段中的错误设置也可能导致WordPress中出现过多重定向问题

We hope this article helped you fix WordPress session timeout issue. If it doesn’t then checkout how to fix WordPress login page refreshing and redirecting issue.

我们希望本文能帮助您解决WordPress会话超时问题。 如果没有,请查看如何解决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 Google+.

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

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-keeps-logging-out-problem/

wordpress注销

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值