wordpress注销_如何在WordPress中强制注销所有用户

wordpress注销

Do you want to force logout all users in WordPress? If you suspect that your WordPress may be hacked or just need users to login again, then there is no default option to do that in WordPress. In this article, we will show you how to easily force logout all users in WordPress.

您是否要强制注销WordPress中的所有用户? 如果您怀疑自己的WordPress可能被黑客入侵或仅需要用户再次登录,则WordPress中没有默认选项。 在本文中,我们将向您展示如何轻松强制注销WordPress中的所有用户。

为什么以及何时要强制注销WordPress中的所有用户? (Why and When You May Want to Force Log out All Users in WordPress?)

If you run a WordPress membership site or an LMS plugin, and you need all logged in users to re-login, then this tutorial is for you.

如果您运行WordPress会员站点LMS插件 ,并且需要所有登录用户才能重新登录,那么本教程非常适合您。

You may want to do this for different reasons. For example, if you suspect that your WordPress site is hacked, then forcing logout will allow you to properly clean up your hacked WordPress site.

您可能出于不同的原因想要这样做。 例如,如果您怀疑自己的WordPress网站被黑,那么强制注销将使您能够正确清理被黑的WordPress网站

Next, if you are using a membership or pay per view site and fear that users may be sharing their passwords to access content, then this method will come in handy. After logging them out, you can stop them from sharing passwords.

接下来,如果您使用的是会员制或按观看次数付费的网站,并且担心用户可能会共享其密码来访问内容,那么此方法将派上用场。 注销它们后,您可以阻止它们共享密码

Another scenario is that when you use a public computer or WiFi without using a VPN service. If you are not sure that you properly logged out, then this method will end all logged in sessions.

另一种情况是,当您使用公用计算机或WiFi而不使用VPN服务时 。 如果不确定正确注销,则此方法将终止所有已登录的会话。

That being said, let’s take a look at how to easily logout all users in WordPress.

话虽如此,让我们看一下如何轻松注销WordPress中的所有用户。

强制注销所有WordPress用户 (Force Log Out All WordPress Users)

For this tutorial, you will be editing WP Config file called wp-config.php. We highly recommend that you backup your wp-config.php file before making any changes to it.

对于本教程,您将编辑名为wp-config.php的WP Config文件 。 强烈建议您在进行任何更改之前备份wp-config.php文件。

First you will need to connect to your website using FTP or via File Manager in cPanel. Once connected, you will find the wp-config.php file in your site’s root folder.

首先,您需要使用FTP或cPanel中的文件管理器连接到您的网站。 连接后,您将在站点的根文件夹中找到wp-config.php文件。

Editing wp-config.php file via FTP

You can right click and select edit to open the file in a text editor.

您可以右键单击并选择编辑以在文本编辑器中打开文件。

Inside your wp-config.php file you will find a code block that would look like this:

在wp-config.php文件中,您将找到一个类似于以下内容的代码块:


define('AUTH_KEY',         'K2#m<|[UO==4Nv c+Ox+^]NH.H*6DmQRJntnj|SwKg)>,>O-z/IeRr?>5lmx`Hf:');
define('SECURE_AUTH_KEY',  '-Qf(}6G(zB`(D*)]fe;iEw?M]PU>BY:$Ni6]~mYCfZ68l_M@R<5E_ICbPUVk.Vf@');
define('LOGGED_IN_KEY',    '6R6:bur.^!Q1K-/H!$]A$g3JaaO]r|B&zu~{-*})|+C|<V,^c|f^vlhp$urvTr7>');
define('NONCE_KEY',        'LM7}+||^qoISh4#q_ ST%#x0vke+TQD(^$W{lVQ_TyV!%,N++H)4+>uSZl6Z%W[3');
define('AUTH_SALT',        'PpS;19y?W31AY@:=,RC;&0kkNXNkP -v=Lr;ghGft:?WV5vA-lje|h{A19Tfzq$[');
define('SECURE_AUTH_SALT', '+H.u}x4u<6-^HY+<?oRkZ{9T)E_)rR+uy.3Rpm*Z&S|UUO|5Wh6cn9.2pq+o4P[M');
define('LOGGED_IN_SALT',   'I{uT;rv5S`JRRs}=1+Ls_3YMDR^;|U[&x^Oy!yg2-:BO%|0W@c-n|SY8D3zo7-8-');
define('NONCE_SALT',       ':0Y`/h3JhwMRNCj~z[1}N@5QKp0|-s4C+XR~/-q6PfZ&Q.qFY5-]qS|L,CNbv>/z');

It is also possible that each of these lines just have ‘put your unique phrase here’ as the second parameter.

这些行中的每一行也可能只是将“您的唯一短语放在这里”作为第二个参数。

These lines are called authentication keys and salts. To learn more about them see our guide on WordPress security keys.

这些行称为身份验证密钥和盐。 要了解有关它们的更多信息,请参阅有关WordPress安全密钥的指南。

Next, you need to visit the WordPress Salts generator page. This page randomly creates new key strings that you can use in your wp-config.php file.

接下来,您需要访问WordPress Salts生成器页面。 此页面随机创建新的密钥字符串,您可以在wp-config.php文件中使用。

Generating WordPress security keys

You need to replace your existing keys with the new ones that you just generated. Once done, make sure to save your changes and upload your wp-config.php file back to the server.

您需要用刚刚生成的新密钥替换现有密钥。 完成后,请确保保存更改并将wp-config.php文件上传回服务器。

Changing the salts will automatically log everyone out of your website, forcing them to relogin.

更改盐将自动使每个人退出您的网站,迫使他们重新登录。

改善WordPress网站上所有用户的密码安全性 (Improving Password Security for All Users on Your WordPress Site)

If you run a membership website or allow users to register on your site, then users are likely to use easy to remember and weak passwords.

如果您经营一个会员网站或允许用户在您的网站上注册 ,则用户可能会使用容易记住且安全性很弱的密码。

Weak passwords are easy to crack and pose a security challenge for your website.

弱密码很容易破解,并给您的网站带来安全挑战。

If you suspect that your website is hacked, then you may want to safely reset passwords for all users on your WordPress site. This will allow them to generate new passwords for their accounts.

如果您怀疑自己的网站已被黑客入侵,则可能需要安全地 WordPress网站上的所有用户重置密码 。 这将使他们能够为其帐户生成新密码。

However, users can still use the same password that they had before. To avoid this from happening again, you can enforce strong passwords for all users on your WordPress site.

但是,用户仍然可以使用以前使用的相同密码。 为了避免再次发生这种情况,您可以 WordPress网站上的所有用户强制使用强密码

One of the most common question we get whenever we recommend using strong passwords is how to remember all those difficult passwords?

每当我们建议使用强密码时,我们会遇到的最常见问题之一是如何记住所有这些难密码?

The answer is simple, you don’t need to. There are apps available that can manage passwords for you. See our guide on how to manage WordPress passwords for more on this topic.

答案很简单,您不需要。 有可用的应用程序可以为您管理密码。 有关此主题的更多信息,请参见我们的如何管理WordPress密码的指南。

We hope this article helped you learn how to force logout all users in WordPress. You may also want to see our complete step by step WordPress security guide for beginners.

我们希望本文能帮助您学习如何强制注销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 Facebook.

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

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-force-logout-all-users-in-wordpress/

wordpress注销

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值