wordpress用户注册_如何在WordPress网站上允许用户注册
2022-07-29 10:13:20
212
{{single.collect_count}}

wordpress用户注册

Do you want to allow users to register on your site? You can enable user registration in WordPress to allow users to add posts, or comment, or perform other actions on your website. In this article, we will show you how to allow user registration on your WordPress site and how to manage users.

是否要允许用户在您的网站上注册? 您可以在WordPress中启用用户注册,以允许用户在您的网站上添加帖子,发表评论或执行其他操作。 在本文中,我们将向您展示如何允许用户在WordPress网站上注册以及如何管理用户。

How to allow user registration in WordPress

影片教学 (Video Tutorial)

演示地址

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

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

在WordPress中启用用户注册 (Enabling User Registration in WordPress)

WordPress comes with built-in functionality to manage user registrations. By default, it is turned off but you can easily turn it on.

WordPress带有内置功能来管理用户注册。 默认情况下,它是关闭的,但是您可以轻松地打开它。

Head over to Settings » General page in your WordPress admin area. Scroll down to the ‘Membership’ section and check the box next to ‘Anyone can register’ option.

转到WordPress管理区域中的 “设置”»“常规”页面。 向下滚动到“会员”部分,然后选中“ 任何人都可以注册”选项旁边的框。

Enable user registration in WordPress

Next you need to select the default user role. This is the user role assigned to each new user who registers on your website.

接下来,您需要选择默认用户角色。 这是分配给在您的网站上注册的每个新用户的用户角色。

Each user role in WordPress comes with its own permissions and capabilities. See our guide on WordPress user roles and permissions to learn more about user roles in WordPress.

WordPress中的每个用户角色都具有自己的权限和功能。 请参阅有关WordPress用户角色和权限的指南,以了解有关WordPress中用户角色的更多信息。

The default user role is subscriber, which you can change to any other user role available. For example, if you want users to write posts on your website then you can change the default user role to Contributor or Author.

默认用户角色是订户,您可以将其更改为任何其他可用的用户角色。 例如,如果您希望用户在您的网站上撰写帖子,则可以将默认用户角色更改为“贡献者”或“作者”。

Important : Never use ‘Administrator’ as the default user role for user registrations.

重要提示:切勿将“管理员”用作用户注册的默认用户角色。

Don’t forget to click on the Save Changes button to store your settings.

不要忘记单击“保存更改”按钮来存储您的设置。

Now your WordPress site is open to user registrations.

现在,您的WordPress网站已向用户注册开放。

在WordPress中添加登录和注册链接 (Adding Login and Register Links in WordPress)

You are now allowing users to register on your website and login. You need to let your users know that they can register and login to your site by adding the links to login and registration pages.

现在,您允许用户在您的网站上注册并登录。 您需要通过添加登录页面和注册页面的链接,让用户知道他们可以注册并登录到您的站点。

There are multiple ways to do that.

有多种方法可以做到这一点。

方法1:将Meta小部件添加到WordPress边栏 (Method 1: Adding The Meta Widget to WordPress Sidebar)

The simplest way to add a login link is by adding the meta widget to your sidebar.

添加登录链接的最简单方法是将meta小部件添加到侧边栏中。

Go to Appearance » Widgets page and add the ‘Meta’ widget to a sidebar. See our guide on how to add and use widgets in WordPress for detailed instructions.

转到外观»小部件页面,然后将“元”小部件添加到侧边栏中。 有关详细说明,请参阅有关如何在WordPress中添加和使用小部件的指南。

Adding Meta widget to your WordPress sidebar

This is how the login link will appear on your website.

Login link in meta widget

这是登录链接将出现在您的网站上的方式。

方法2:创建自定义登录页面 (Method 2: Creating Custom Login Pages)

The problem with the first method is that it gives users access to the admin area of your WordPress site. Using your own custom login pages will allow users to login without accessing your WordPress admin area.

第一种方法的问题在于,它使用户可以访问WordPress网站的管理区域。 使用您自己的自定义登录页面将允许用户登录而无需访问您的WordPress管理区域。

Here is how to create your own custom login and registration page in WordPress.

这是在WordPress中创建自己的自定义登录和注册页面的方法。

First thing you need to do is install and activate the WPForms plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您需要做的第一件事是安装并激活WPForms插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

WPForms is a premium WordPress forms plugin. You will need at least pro license to access user registration addon.

WPForms是一个高级WordPress表单插件 。 您至少需要专业许可才能访问用户注册插件。

WPBeginner users can use the WPForms Coupon: SAVE50 to get 50% off on their purchase.

WPBeginner用户可以使用WPForms优惠券 :SAVE50获得50%的购买折扣。

Upon activation, you need to visit WPForms » Settings page to enter your license key. You can get this license key from your account on WPForms website.

激活后,您需要访问WPForms»设置页面以输入许可证密钥。 您可以从WPForms网站上的帐户中获取此许可证密钥。

WPForms license key

After verification, you need to head over to WPForms » Addons page.

验证后,您需要转到WPForms»Addons页面。

Scroll down to ‘User Registration Addon’ and click on the Install Addon button next to it.

向下滚动到“用户注册插件” ,然后单击其旁边的“安装插件”按钮。

User registration addon

WPForms will fetch and install the addon. You will need to click on the activate button to start using this addon.

WPForms将获取并安装插件。 您将需要单击激活按钮才能开始使用此插件。

You are now ready to create custom registration and login forms using WPForms.

现在,您可以使用WPForms创建自定义注册和登录表单。

Creating a Custom Registration Form

创建自定义注册表格

Visit WPForms » Add New page. This will launch WPForms’ form builder.

访问WPForms»添加新页面。 这将启动WPForms的表单生成器。

First you need to enter a form name and then from ‘Select a Template’ section click on ‘User Registration Form’ template.

首先,您需要输入表单名称,然后在“选择模板”部分中单击“用户注册表单”模板。

User registration form template

WPForms will create a simple WordPress user registration form for you.

WPForms将为您创建一个简单的WordPress用户注册表单。

You can add new fields from the left panel as well as customize the order of existing fields by using a simple drag and drop interface.

您可以从左侧面板添加新字段,也可以使用简单的拖放界面自定义现有字段的顺序。

Editing user registration form

Once you are done adding the fields, click on the ‘Settings’ menu on the left and then select the ‘User Registration’ tab.

添加完字段后,单击左侧的“设置”菜单,然后选择“用户注册”标签。

User registration form settings

Here you can map each field, select user role, enable notifications, select the confirmation page, and enable user activation.

您可以在此处映射每个字段,选择用户角色,启用通知,选择确认页面并启用用户激活。

The user activation feature helps you reduce spam user registration in WordPress.

用户激活功能可帮助您减少WordPress中的垃圾邮件用户注册

If you select the manual method, then all users must be approved by an admin before they can login to your site. If you select the email method, then the user must click on an activation link before they can login.

如果选择手动方法,则所有用户都必须先获得管理员的批准,然后才能登录到您的网站。 如果选择电子邮件方法,则用户必须单击激活链接才能登录。

You can combine the user registration addon with other WPForms addons. You can use WPForms email marketing addons like MailChimp and AWeber as well as payment addons like Stripe.

您可以将用户注册插件与其他WPForms插件结合使用。 您可以使用WPForms电子邮件营销附加组件(如MailChimpAWeber )以及付款附加组件(如Stripe)。

Don’t forget to click on the save button at the top right corner of the screen to save your form settings.

不要忘记单击屏幕右上角的保存按钮以保存表单设置。

You can now exit the form builder by clicking on the close button.

现在,您可以通过单击关闭按钮退出表单构建器。

Your user registration form is ready to be added to your WordPress site.

您的用户注册表已准备好添加到WordPress网站。

Simply create a new WordPress page or edit an existing page that you would like to use as registration page.

只需创建一个新的WordPress页面或编辑一个您想用作注册页面的现有页面即可。

On the page edit screen, you will notice the ‘Add Form’ button.

在页面编辑屏幕上,您会注意到“添加表单”按钮。

Add form to a page

Clicking on it will bring up a popup where you can select the user registration form you just created.

单击它会弹出一个弹出窗口,您可以在其中选择刚刚创建的用户注册表单。

Select and add user registration form to a page in WordPress

Click on the ‘Add Form button’ and you will notice a WPForms shortcode will appear in the post editor.

单击“添加表单按钮”,您会发现WPForms短代码将出现在帖子编辑器中。

You can now save or publish your page. Visit the page in a new browser tab to see your custom user registration page in action.

您现在可以保存或发布页面。 在新的浏览器标签中访问页面,以查看您的自定义用户注册页面。

Custom user registration page

Creating a Custom Login Form

创建自定义登录表单

Now that your custom user registration page is active. Let’s add a custom login form to your WordPress site.

现在,您的自定义用户注册页面已激活。 让我们向您的WordPress网站添加自定义登录表单。

Visit WPForms » Add New page. This will launch the Form Builder interface of WPForms.

访问WPForms»添加新页面。 这将启动WPForms的Form Builder界面。

You need to provide a name for your custom login form and then select ‘User Login Form’ as your template.

您需要为自定义登录表单提供一个名称,然后选择“用户登录表单”作为模板。

Select user login form template

WPForms will now create a form with the login fields.

WPForms现在将使用登录字段创建一个表单。

Editing user login form

You can add additional fields to the form by adding them from the left panel.

您可以通过从左侧面板添加其他字段来将其添加到表单中。

Next you need to click on the settings tab and then click on ‘Confirmation’ tab. This is where you can define what to do after a successful login.

接下来,您需要单击设置选项卡,然后单击“确认”选项卡。 在这里,您可以定义成功登录后的操作。

You can show users a message, redirect them to the page they came from, or redirect them to any other page on your site.

您可以向用户显示一条消息,将他们重定向到他们来自的页面,或将他们重定向到您网站上的任何其他页面。

Redirect users after login

Click on the Save button on the top right corner of the screen to store your form settings.

单击屏幕右上角的“保存”按钮以存储您的表单设置。

You can now exit the form builder interface by clicking on the close button.

现在,您可以通过单击关闭按钮退出表单构建器界面。

You custom login form is ready to be added into your WordPress site.

您可以将自定义登录表单添加到WordPress网站中。

You can add your custom login form to a page by creating a new page and then clicking on the Add Form button.

您可以通过创建新页面,然后单击“添加表单”按钮将自定义登录表单添加到页面。

Add login form to a page

You can also add your custom login form to a sidebar. Simply head over to Appearance » Widgets page and add WPForms widget to a sidebar.

您还可以将自定义登录表单添加到侧边栏。 只需转到外观»小部件页面,然后将WPForms小部件添加到侧边栏即可。

Adding login widget to your WordPress sidebar

Select the custom login form you just created and then click on save button to store your widget settings.

选择您刚刚创建的自定义登录表单,然后单击“保存”按钮以存储您的小部件设置。

You can now visit your website to see your custom login form in action.

现在,您可以访问您的网站以查看您的自定义登录表单。

Login widget

For more on this topic, see our guide on how to create a custom login page for WordPress.

有关此主题的更多信息,请参见有关如何为WordPress创建自定义登录页面的指南。

在WordPress中管理用户 (Managing Users in WordPress)

You can view all registered users on your website by clicking on Users in the WordPress admin. WordPress will show you a list of users with their usernames, names, role, and email addresses.

您可以通过单击WordPress管理员中的“用户”来查看您网站上的所有注册用户。 WordPress将向您显示用户列表,包括用户名,名称,角色和电子邮件地址。

User management in WordPress

As an administrator, you can delete any user at any time you want.

作为管理员 ,您可以随时删除任何用户。

You can also edit user profiles, change their roles, and you can even change their passwords.

您还可以编辑用户个人资料,更改其角色,甚至可以更改其密码。

This gives you full control on what users can or cannot do on your WordPress site.

这使您可以完全控制用户在WordPress网站上可以做什么或不能做什么。

That’s all, we hope this article helped you learn how to allow user registration on your WordPress site. You may also want to learn how to add or remove capabilities to user roles in WordPress.

仅此而已,我们希望本文能帮助您学习如何允许用户在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/beginners-guide/how-to-allow-user-registration-on-your-wordpress-site/

wordpress用户注册

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}