Best WordPress Plugins - We did the Research For You https://www.wpbeginner.com Beginner's Guide for WordPress Mon, 14 Oct 2024 10:00:05 +0000 en-US hourly 1 How to Restrict User Login to One Device in WordPress https://www.wpbeginner.com/plugins/how-to-restrict-user-login-to-one-device-in-wordpress/ https://www.wpbeginner.com/plugins/how-to-restrict-user-login-to-one-device-in-wordpress/#comments Mon, 14 Oct 2024 10:00:00 +0000 https://www.wpbeginner.com/?p=307227 People often share their Netflix logins with friends. To prevent password sharing from getting out of hand, online services have now started limiting the number of devices that can use one account at a time. Many of our readers run membership websites and offer online… Read More »

The post How to Restrict User Login to One Device in WordPress first appeared on WPBeginner.

]]>
People often share their Netflix logins with friends. To prevent password sharing from getting out of hand, online services have now started limiting the number of devices that can use one account at a time.

Many of our readers run membership websites and offer online courses. They tell us that they are just as concerned about people sharing their login details because it leads to a loss of income for their business. That’s why they would like to set up similar login restrictions.

In this article, we will explain how to limit each user’s login to just one device on your WordPress website. By the end of this guide, you’ll know how to protect your content and ensure only paying members can access it, helping your online business stay fair and profitable.

How to Restrict User Login to One Device in WordPress

Why Restrict User Login to One Device in WordPress?

Streaming services face the challenge of users sharing their login credentials. In 2023, Netflix reported that about 100 million households were sharing passwords globally. That’s huge!

Many WordPress websites, especially membership and e-learning sites, have the same problem. By default, WordPress users can log in from unlimited devices and browsers simultaneously.

This practice seems harmless to those users, but it can significantly impact a website’s revenue and user experience. For example:

  • Membership sites offer special content to people who pay. When users share logins, fewer people buy memberships. This means less money for the site owner.
  • When students share their online learning logins, other users do not need to buy the course. Plus, it makes it hard to offer personalized help or know who finishes the course.

When you limit user logins to one device, you can know how many real users you have, make more money, and maintain the value of your content or services. Besides that, you will provide a fair experience to all paying users and keep your website safer.

Limiting logins isn’t about not trusting users. It’s about keeping the website fair and making sure it can keep running. This helps both the website owner and the honest users.

Restricting User Login to One Device in WordPress (Easy)

The first thing you need to do is install and activate the free Loggedin – Limit Active Logins plugin. You can find step-by-step help in our guide on how to install a WordPress plugin.

Upon activation, the plugin starts to work automatically and limits each user to 3 active logins.

Depending on the settings, the user may not be able to log in on a new device once this limit has been reached until they log out from one of their other devices. More on that below.

This User's Login Limit Has Been Reached

Note: After logging in to WordPress, the user will usually remain logged in even if they close their web browser. They need to manually log out using the ‘Howdy’ menu at the top right corner of the screen.

You can configure the plugin by visiting Settings » General in your WordPress dashboard and then scrolling down to the ‘Loggedin Settings’ section.

Here, you can change the number in the ‘Maximum Active Logins’ field to allow a different number of logins.

Loggedin Plugin Settings

The ‘Login Logic’ setting determines what happens when the user reaches the maximum active login limit:

  • Allow: They can log in on a new device but will be automatically logged out of all other devices.
  • Block: They will not be able to log in on the new device until their other login sessions expire.

So, if you wish to restrict user login to just one device, then you need to set the ‘Maximum Active Logins’ to 1 and the ‘Login Logic’ to Block.

Or, if you don’t mind which device they use as long as they are logged on to just one device at a time, then you should set ‘Maximum Active Logins’ to 1 and ‘Login Logic’ to Allow.

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

The plugin also allows you to force logout a single user from all devices. Simply enter their user ID and then click the ‘Force Logout’ button.

You can learn how to find a user ID in our guide on how to find post, category, tag, comments, or user ID in WordPress.

Bypassing Login Restrictions for Certain Users or Roles (Advanced)

You can bypass these login restrictions for certain users or user roles.

For example, you may want to make sure that your site administrators and editors are not accidentally locked out. Or you may have an important team member who works on different computers in multiple locations.

However, to do this, you will need to add custom code snippets to your WordPress theme’s functions.php file. Even a tiny mistake can break your WordPress site and make it inaccessible, so you should take a look at our guide on how to easily add custom code in WordPress.

We recommend you use WPCode because it is the safest way to add code snippets, and you will not need to manually edit the functions.php file.

Bypassing Login Restrictions for Certain Users

Simply install and activate the free version of WPCode and then navigate to Code Snippets » + Add Snippet in your WordPress dashboard.

Next, hover your mouse over the ‘Add Your Custom Code (New Snippet)’ entry and then click the ‘Use snippet’ button that appears.

Adding a New Snippet in WPCode

A popup at the bottom of the screen will ask you to select the code type for your snippet.

You should click the ‘PHP Snippet’ option.

Select the PHP Snippet Option in WPCode

This will open the Create Custom Snippet page, where you can add the code you need. You can start by adding a title for the snippet, such as ‘Bypass Login Restrictions for Certain Users’.

After that, you should copy the code snippet below and paste it into the ‘Code Preview’ pane:

function loggedin_bypass_users( $bypass, $user_id ) {

    // Enter the user IDs to bypass.
    $allowed_users = array( 1, 2, 3, 4, 5 );

    return in_array( $user_id, $allowed_users );
}

add_filter( 'loggedin_bypass', 'loggedin_bypass_users', 10, 2 );

Now look at the line that starts with $allowed_users = array. You need to replace ‘1, 2, 3, 4, 5’ with the user IDs for the specific users you wish to bypass the restriction. You can add any number of user IDs, and they should be separated by commas.

You can learn how to find a user ID in our guide on how to find post, category, tag, comments, or user ID in WordPress

Finally, you need to toggle the snippet to ‘Active’ and then click the ‘Save Snippet’ button to store your settings.

Code Snippet so Certain Users Bypass Login Restrictions

Bypassing Login Restrictions for Certain Roles

You can follow the same steps to add a code snippet to bypass login restrictions for certain roles.

Simply create a new code snippet called ‘Bypass Login Restrictions for Certain Roles’ and then paste the following code snippet in the ‘Code Preview’ pane:

function loggedin_bypass_roles( $prevent, $user_id ) {

    // Array of roles to bypass.
    $allowed_roles = array( 'administrator', 'editor' );

    $user = get_user_by( 'id', $user_id );

    $roles = ! empty( $user->roles ) ? $user->roles : array();

    return ! empty( array_intersect( $roles, $whitelist ) );
}

add_filter( 'loggedin_bypass', 'loggedin_bypass_roles', 10, 2 );

This snippet bypasses the restriction for the ‘administrator’ and ‘editor’ roles. You can add any other roles, such as ‘author’, in single quotation marks and separated by commas.

Be sure to toggle the snippet to ‘Active’ and click the ‘Save Snippet’ button when you are done.

Code Snippet so Certain Roles Bypass Login Restrictions

We hope this tutorial helped you learn how to restrict user login to one device in WordPress. You may also want to see our ultimate guide on creating a WordPress membership site or our expert pick of the best WordPress LMS plugins.

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.

The post How to Restrict User Login to One Device in WordPress first appeared on WPBeginner.

]]>
https://www.wpbeginner.com/plugins/how-to-restrict-user-login-to-one-device-in-wordpress/feed/ 2
Taxonomy SEO – How to Optimize Your WordPress Category Pages https://www.wpbeginner.com/plugins/taxonomy-seo-how-to-optimize-your-wordpress-category-pages/ https://www.wpbeginner.com/plugins/taxonomy-seo-how-to-optimize-your-wordpress-category-pages/#comments Tue, 10 Sep 2024 10:00:00 +0000 https://www.wpbeginner.com/?p=285472 Even if you’ve been working hard to improve your WordPress site’s SEO, you may not have considered taxonomy SEO. Over the years of trying different SEO strategies, we have discovered that optimizing category pages and other taxonomy archives can significantly improve a website’s rankings on… Read More »

The post Taxonomy SEO – How to Optimize Your WordPress Category Pages first appeared on WPBeginner.

]]>
Even if you’ve been working hard to improve your WordPress site’s SEO, you may not have considered taxonomy SEO.

Over the years of trying different SEO strategies, we have discovered that optimizing category pages and other taxonomy archives can significantly improve a website’s rankings on search engine results pages (SERPs).

In this article, we will show you how to optimize your category pages and other taxonomy archives for SEO in WordPress.

Taxonomy SEO - How to Optimize Your WordPress Category Pages

Why Are Category Pages Important for WordPress SEO?

In WordPress, taxonomies are used to organize a website’s content. They let you group related posts together, helping your website visitors quickly find what they need.

The default WordPress taxonomies are categories, which act as a website’s table of contents, and tags, which can be thought of as an index section.

Some websites also add subcategories and custom taxonomies to sort their content in even more ways. For example, many eCommerce plugins automatically create a custom Product taxonomy.

When your website content is carefully organized, visitors and search engines can easily navigate it, resulting in happier users and improved search rankings.

Our guide on SEO best practices for sorting your content teaches you how to use categories and tags effectively.

But in this tutorial, we will focus on how to improve SEO by optimizing WordPress category pages.

Need help with your SEO? Our WordPress SEO Services include AIOSEO plugin configuration, keyword research, on-page optimization, and more. Stop struggling with SEO and get started with our affordable WordPress SEO Services today!

What Is a Category Page in WordPress?

Each taxonomy has an archive page that includes a title and description as well as a list of posts contained in that taxonomy.

For example, our WPBeginner Tutorials category page has the title ‘700+ Best Free WordPress Tutorials’. A detailed description follows, where we explain how our tutorials help you learn WordPress to improve your website, and we list some popular tutorials.

Category Page Example

We also include a link to our YouTube channel for those who prefer to watch videos.

After the category description, you will find a list of posts in the Tutorials category, starting with the most recently published ones.

Category Page Example

By default, category archive pages are indexed by Google and other search engines.

In this screenshot, you can see that our Tutorials category is included in Google search results. The listing includes the category page’s title and description.

Example of How a Category Page Appears in Search Results

Clicking the link will take you straight to the Tutorials category page on WPBeginner.

Improving Category Page SEO in WordPress

Optimizing the content on your WordPress category pages is an effective way to improve your website’s SEO when done correctly.

We recommend using the All in One SEO (AIOSEO) WordPress plugin. It’s the best SEO plugin for WordPress and helps you optimize your site for search engines without needing any technical SEO knowledge.

All in One SEO

You can access many of the Taxonomy SEO features in the AIOSEO free version. Additionally, the premium version of AIOSEO offers advanced features like removing the category base, optimizing custom taxonomies, TruSEO on-page analysis for taxonomies, and more.

You can learn how to install and configure AIOSEO in our guide on how to set up All in One SEO for WordPress correctly.

Now, let’s take a look at how to optimize category pages and other taxonomy archive pages in WordPress. You can use the links below to jump to the section you are most interested in:

1. Avoid Keyword Cannibalization Between Categories and Posts

One concern with taxonomy SEO is that your category pages may compete with WordPress posts for the same keyword. This is known as keyword cannibalization and can create a confusing situation for search engines.

We talk more generally about how to fix keyword cannibalization issues in our guide on how to improve your organic click-through rate in WordPress.

There are a few ways to avoid cannibalization issues when it comes to category archive pages.

For example, some websites target different keywords when optimizing category pages and blog posts. Other websites avoid the problem by asking search engines not to index categories.

Let’s take a look at these two approaches so you can choose the one that best suits your website.

Choosing Not to Index Category and Tag Archive Pages

Some users stop search engines from indexing their category and tag archive listings. This encourages search engines to prioritize their actual posts and pages. It also prevents keyword cannibalization from categories and tags.

You need to navigate to All in One SEO » Search Appearance and click the ‘Taxonomies’ tab.

AIOSEO Search Appearance for Categories

Now look for the ‘Show in Search’ setting under Categories and select the ‘No’ option.

Next, you need to scroll down and do the same thing for tags.

AIOSEO Search Appearance for Tags

Once you click the ‘Save Changes’ button at the top or bottom of the page, search engines will no longer index your category and tag archive pages.

Since they won’t appear in search results, you will not need to optimize them for SEO. However, you may still wish to follow some of the steps below to improve user experience.

Optimizing Categories and Posts for Different Keywords

Another approach users take to prevent keyword cannibalization is to target different keywords on taxonomy archive pages and posts.

For example, imagine a review website that covers running shoes:

  • The category page for this topic would target the broad keyword of ‘Running Shoes’. The description could include an overview of the different types of running shoes and a buyer’s guide to choosing the right running shoes.
  • Meanwhile, the individual posts would review specific types or models of running shoes. They might target long-tail keywords like ‘best stability running shoes’, ‘lightweight running shoes for marathons’, and more.

By using this approach, both the category page and the individual posts can rank for relevant keywords without competing with each other.

The category page will act as a hub, attracting users with a general interest in running shoes. The individual reviews will be displayed on search results for users with more specific needs.

This improves the website’s overall SEO performance by targeting a wider range of relevant keywords and providing a more comprehensive user experience.

Tip: When optimizing category pages for SEO, you may wish to hide your tags from search engines using the method above. This will ensure there is no keyword cannibalization between your categories and tags.

2. Optimize the URL Structure for Categories

Your category URLs should be short, easy to understand, and include relevant keywords. Luckily, WordPress uses an SEO-friendly URL structure for categories, posts, and pages.

By default, your categories will have URLs (or permalinks) that look like this:

https://example.com/category/running-shoes/

This URL starts with the website’s domain name followed by the category base prefix, which is ‘category’. After that, you see a slug that identifies the category.

In this case, that’s ‘running-shoes’, where a hyphen is automatically used to separate different words.

This structure works well for most websites. However, depending on your needs, you can change the base to a different word, like ‘topics’.

Simply go to Settings » Permalinks in WordPress admin and type the base you wish to use into the ‘Category base’ field. Make sure you click the ‘Save Changes’ button to store your settings.

If you change the category base to ‘topics’, then category permalinks will now look like this:

https://example.com/topics/running-shoes/

Note that you can change the tag base from ‘tag’ to something else on the same page.

Some users prefer to completely remove the category base prefix to simplify their category URLs. The prefix doesn’t have any SEO benefit, and removing it shortens the URL and makes it easier to read.

You can easily do this using a premium feature of All in One SEO. Simply navigate to All in One SEO » Search Appearance and then click on the ‘Taxonomies’ tab.

AIOSEO Remove Category Base Prefix

Now, under the ‘Categories’ section, click on the ‘Advanced’ tab and select the ‘Yes’ option next to ‘Remove Category Base Prefix’.

Your category permalinks will now look like this:

https://example.com/running-shoes/

For detailed instructions, see our guide on how to change the category base prefix in WordPress.

3. Set the Default SEO Title and Description Format for Categories

All in One SEO lets you customize the default format for how categories appear on search engine results pages.

You can find these settings by navigating to All in One SEO » Search Appearance and opening the ‘Taxonomies’ tab.

All in One SEO Taxonomies Settings

AIOSEO uses dynamic tags to set the default formats of the SEO title and description of your categories.

By default, search engines will display the title as the category title and site title. The meta description will simply be the category description.

If you glance at the Preview section, you can see how this will appear in search results.

These default settings will work for most websites, but you can customize them by adding or removing dynamic tags.

This format will be used to set the initial meta title and description of each category. In the next section, we’ll show you how to customize them for specific categories.

4. Add a Helpful Name and Description for Each Category

You should add a short description to each category page to give users a better understanding of the content they’ll find.

As you saw above, category names and descriptions are displayed on search engine results pages and may encourage more users to click your link.

Besides that, Google looks for helpful and readable content on your website when deciding what to rank highest in search results.

Example of How a Category Page Appears in Search Results

First, head over to the Posts » Categories page in your WordPress dashboard. This will display a list of your existing categories and subcategories and allow you to add new categories.

Now you need to click the ‘Edit’ link next to the category you wish to add content to.

The Posts»Categories Page

This will take you to the category edit screen, where you can add a title, slug, and description for your category.

The slug will be used in category URLs and should be kept short and simple. However, the category name will be displayed at the top of category archive pages, so this can be longer and more descriptive.

Choose a name that accurately reflects the content within that category.

Add a Description to a Category

You should also add a compelling description of at least 300 words that expands on the category name and introduces the topic. This can be similar to a blog post introduction.

You can write this in plain text in the Description field. If you would like to add headings, formatting, images, or links to the description, then you will need to use HTML code.

For example, HTML heading tags will look like this:

<h1>This Is a Main Heading</h1>
<h2>This Is a Subheading</h2>

You can add HTML using anchor tags like this:

<a href="https://www.example.com">click on this anchor text</a>

And you can add images like this:

<img src="image.jpg" alt="A description of the image">

Don’t forget to click on the ‘Update’ button to save your changes.

This category name and description will be displayed on your website and search engine results pages by default.

Alternatively, if you are using the Pro version of All in One SEO, then you can set a different SEO title and meta description for your category.

Simply scroll down the category page until you see the ‘AIOSEO Settings’ section. Here, you can override the default SEO title and description formats you created in section 3 above.

Customizing a Category Page's Meta Title and Description Using AIOSEO

Just delete any or all dynamic tags and type the text you wish to use.

Now, you’ll need to repeat this process to add titles and descriptions to all your categories. After that, you might like to do the same thing with your tags by visiting Posts » Tags.

5. Optimize the Content of Each Category Description for SEO

You can also optimize each category description the same way you optimize your blog posts for SEO. This will help your category pages rank higher in search results.

This starts with doing keyword research to make sure that your category description includes phrases users are likely to search for.

Wherever possible, you should add internal links to improve navigation and help search engines understand the relationship between your categories and posts.

For example, you could include links to related categories and subcategories in the description and also add links to your category pages in related blog posts. You can also automatically display subcategories on category pages.

Also, make sure that you optimize any images you use for search engines.

Finally, you can improve the headline using AI. Optimizing the category name will make it stand out and motivate users to click it when they see it in search results. One of the best ways to do this is using our free Headline Analyzer.

6. Add Breadcrumb Navigation to Your WordPress Website

Breadcrumbs are an extra navigation system that you can add to your WordPress website to help users find your content.

They let users see where they are located in the hierarchy of your website. They also help search engines like Google crawl your website more effectively and understand the structure of your site. This can help your website rank higher for relevant keywords.

We use breadcrumbs on WPBeginner, and you can see them on every category page and post:

Example of Breadcrumbs on a Category Page

For detailed instructions on how to add them to your website, see our guide on how to display breadcrumb navigation links in WordPress.

If you have an online store, then you can follow our beginner’s guide on how to add breadcrumbs in WooCommerce.

Now that you’ve learned about taxonomy SEO, you may like to see some guides related to other ways to improve website SEO in WordPress:

We hope this tutorial helped you learn how to optimize your WordPress category pages. You may also want to see our guide on whether categories or tags are best for SEO or our ultimate guide to WordPress SEO.

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.

The post Taxonomy SEO – How to Optimize Your WordPress Category Pages first appeared on WPBeginner.

]]>
https://www.wpbeginner.com/plugins/taxonomy-seo-how-to-optimize-your-wordpress-category-pages/feed/ 1
How to Create WordPress Forms With Dropdown Fields (Easy Method) https://www.wpbeginner.com/plugins/how-to-create-wordpress-forms-with-dropdown-fields-easy-method/ https://www.wpbeginner.com/plugins/how-to-create-wordpress-forms-with-dropdown-fields-easy-method/#comments Wed, 21 Aug 2024 10:00:00 +0000 https://www.wpbeginner.com/?p=281442 Many website owners struggle to collect user input without overwhelming those users with lengthy forms. Dropdown fields make forms simpler by presenting a concise list of options. This means that they could boost your form completion rate and improve the user experience. In this article,… Read More »

The post How to Create WordPress Forms With Dropdown Fields (Easy Method) first appeared on WPBeginner.

]]>
Many website owners struggle to collect user input without overwhelming those users with lengthy forms.

Dropdown fields make forms simpler by presenting a concise list of options. This means that they could boost your form completion rate and improve the user experience.

In this article, we will show you how to create a WordPress form with dropdown fields.

The Create WordPress Forms with Dropdown Fields in post image

What Are Dropdown Fields and Why Use Them?

A dropdown field lets users choose one option from a set list of different variations. Users can simply click on the field to see all the dropdown choices.

As a website owner, you can use dropdown fields to create web forms, such as email newsletter signups, contact forms, event registration forms, or product order forms.

Dropdown fields can improve your form’s effectiveness. Here are a few advantages:

  • Consistency. The set list of options keeps the collected data consistent and prevents invalid entries. This makes data analysis more accurate.
  • Dynamic fields. Dropdown fields make it easier to set conditional logic. The set list of options lets you show additional fields based on user selection without unnecessary hurdles.
  • Reduced form length. Combining multiple options into a compact dropdown menu makes your form look less intimidating. This can result in a better user experience.

That being said, let’s take a look at how to create forms with dropdown fields in WordPress. Here is a quick overview of the steps we will cover in this tutorial:

Let’s get started!

Step 1: Installing WPForms

WPForms is the best beginner-friendly, drag-and-drop WordPress plugin for creating forms. This form builder has 1,800+ templates, which help you make a user-friendly form in just a few clicks.

It also allows you to integrate third-party marketing and payment platforms, including Constant Contact and Stripe.

WPForms

Notes: WPForms Lite comes with the dropdown field feature. That said, we recommend getting the premium version of the plugin so you can set conditional logic and improve user experience on your form.

The good news is WPBeginner readers get a special 50% off by using the WPForms coupon: SAVE50.

To install and activate WPForms, you can read our guide on how to install a WordPress plugin.

Step 2: Creating a New Form

Upon activation, you should see a WPForms menu in your WordPress admin area like this:

The WPForms menu in the WordPress admin area

Now, you’ll be able to access the WPForms builder interface and create forms with dropdown fields.

To start building a new form, hover over WPForms and click ‘Add New’.

The Add New button under WPForms in the WordPress admin area

Alternatively, you can click WPForms. This will redirect you to the builder’s ‘Forms Overview’ section.

To get started, click the ‘+ Add New’ button.

The + Add New button on WPForms' Forms Overview

Now, you’ll see the ‘Setup’ panel within the WPForms form builder. In this panel, the first thing you’ll need to do is to name your form.

For example, you can type ‘Simple Contact Form’ or just ‘Contact Form’ into the ‘Name Your Form’ field.

The Contact Form copy in the Name Your Form field in WPForms' Setup panel

Once that’s done, it’s time to select a template.

To use a form template, all you have to do is hover over the one you want and click ‘Use Template’. In this example, we are going to use ‘Simple Contact Form’.

The Use Template button for Simple Contact Form in WPForm's Setup panel

To learn more about making a contact form, see our detailed guide on how to create a contact form in WordPress.

Step 3: Adding the Dropdown Field

After completing the setup process, you’ll be redirected to the form builder, where there is a list of fields on the left and a live preview on the right.

Edit contact form

Now, we want to add a dropdown field to our contact form.

Simply click ‘Dropdown’ and drag it onto the right side of the form.

The Dropdown option in WPForm's Fields panel

Notes: All the fields in the ‘Standard Fields’ category are available on WPForms Lite. So, you can create forms with multiple-choice fields or add CAPTCHA in login and registration forms for free.

To the right of the panel, you’ll be able to see a dropdown field on your contact form. You can hover over the field to access its settings, which include:

  • A copy button
  • A delete button
  • A ‘Click to Edit’ instruction
  • A ‘Drag to Reorder’ instruction
The dropdown field on the live preview

Using the drag-and-drop feature, let’s move the dropdown field above ‘Comment or Message’.

By having the ‘Comment or Message’ paragraph field right before the submit button, you offer a better flow for the form completion process. It also makes your dropdown field more visible so users don’t overlook it.

The dropdown field moved above Comment or Message

Step 4: Configuring the Dropdown Field

In this step, you’ll set your dropdown field’s label, options, and description. Your list of options should align with your form type. Since we’re creating a contact form, let’s offer a newsletter subscription option.

Click on your dropdown field and then go to ‘Field Options’.

The Dropdown field's Field Options tab

On the ‘General’ tab, fill out the necessary details:

  • Label. In dropdown fields, labels are usually questions. We’ll use ‘Would you like to subscribe to our newsletter?’ as an example.
  • Choices. Let’s add ‘Yes, please.’ and ‘No, thank you.’
  • Description. You can leave ‘You can unsubscribe at any time.’ in this field.
  • Required. Toggle this option to require visitors to complete this field.
The configured Dropdown field in the Field Options tab

Next, let’s set conditional logic.

Conditional logic means making decisions with ‘if’ and ‘then’ statements. When used in forms, it decides what happens next based on the answer that a user gives.

Setting up conditional logic makes forms easier to complete. By showing only relevant options based on previous selections, your form doesn’t overwhelm users with unnecessary choices.

In this example, let’s display an additional field if users choose the ‘Yes, please’ option. We will allow the subscribers to choose how frequently they would like to receive promotional emails.

Before that, you’ll need to prepare a new field. Go back to the ‘Add Fields’ tab and click ‘Dropdown’ or any other field type. Then, complete the new field’s details.

Here’s an example:

The configured second dropdown field in the Field Options tab for setting up conditional logic

Now that the new field is ready, click on it and navigate to the ‘Smart Logic’ tab.

From here, you can activate conditional logic by toggling the ‘Enable Conditional Logic’ option.

The Enable Conditional Logic toggle in the Smart Logic tab

Once activated, you can configure conditional logic for your new field.

Start with choosing to ‘Show’ or ‘Hide’ the new field. Then, select an existing field and a user input.

Here’s our configuration for reference: ‘Show’ this field if ‘Would you like to subscribe to our newsletter’ is ‘Yes, please’.

The conditional logic for the second Dropdown field in the Smart Logic tab

Expert Tip: Want to add users directly to your email list? Just check out our tutorial on how to build an email list in WordPress.

Step 5: Personalizing Your Form

It’s time to personalize your new form.

You can start by setting up email notifications every time a new user submits a form. Head to Settings » Notifications and toggle the ‘Enable Notifications’ option.

The Enable Notifications toggle in WPForms' Notifications section in the Settings panel

Then, go through your form’s default notification details below the toggle.

Some entries in the ‘Default Notification’ field have ‘Smart Tag’. This tag assumes where to send form submission notifications, among others. That said, you can adjust the settings based on your needs.

For example, the ‘Sent To Email Address’ field has the {admin_email} ‘Smart Tag’. By default, this will be your WordPress site’s admin email. So, any form submission notifications will go to the admin email’s inbox.

You can add more recipients, such as your email marketing specialist. Just be sure to separate each email with a comma.

If you want to learn how to send your form email to multiple people or different departments, read our guide on how to create a contact form with multiple recipients.

Next, the default copy for your ‘Email Subject Line’ is ‘New Entry: Your Form Name’. However, you can change the subject line to your liking as long as it’s easy to identify.

Users who submit a form should receive a notification in their emails. The ‘From Name’ field lets users know who sends the notification email.

WPForm's Default Notifications settings for the first three fields

The next field is ‘From Email’, and the ‘Smart Tag’ for this field is {admin_email}.

With this default setting, users will receive notification emails from your site’s admin email.

The highlighted part informs you that your site’s admin email address is on a different domain, for example, @gmail.com. This can lead to deliverability issues, such as emails ending up in the ‘Spam’ box.

You can read our guide on setting up WP Mail SMTP to make sure that your emails end up in readers’ inboxes.

WPForm's Default Notifications settings for the From Email field

For each notification email sent, the recipient also has the option to reply to it.

In the ‘Reply-To’ field, you can set which email address will receive user replies. This field’s ‘Smart Tag’ is {field_id= “1”}. It means that users’ replies will go to the same email address as the one in the ‘From Email’ field.

Lastly, the ‘Email Message’ field has the {all_fields} ‘Smart Tag’. So, your email message will contain your form fields along with user responses.

WPForm's Default Notifications settings for the last two fields

Once you’ve finished customizing your notifications, navigate to ‘Confirmations’. In this section, you’ll set up how you would display confirmation after form submission.

First, you can choose ‘Messages’, ‘Show Page’, or ‘Go to URL (Redirect)’ as your confirmation type.

The Confirmation Type field in WPForms' Confirmations section in the Settings panel

If you choose ‘Message’ as your confirmation type, you’ll display a confirmation message to let users know you’ve received their form submissions.

With this confirmation type, you can edit the default message to fit your brand. Go to the ‘Confirmation Message’ field and type your custom message into the text box.

The Confirmation Message field in WPForms' Confirmation section in the Settings panel

If you choose ‘Show Page’, you’ll need to select an existing page on your WordPress website. And if you opt for ‘Go to URL (Redirect)’, you’ll insert a page URL.

Before you move on to the next step, click ‘Save’ so you don’t lose your progress.

The Save button on WPForms' builder interface

Once that’s done, you are ready to display your new form on your WordPress site.

Step 6: Embedding Your Form in WordPress

To display your new form on your WordPress site, you can use the ‘Embed’ wizard within the WPForms form builder.

The Embed wizard on the WPForms form builder

This will trigger the ‘Embed in a Page’ pop-up window. On it, you can choose ‘Select Existing Page’ or ‘Create New Page’, whichever is relevant to you.

In this example, let’s go with ‘Selecting Existing Page’.

The Select Existing Page button when embedding a form from WPForms

The next step is to choose the page where you want to display your new form.

Simply click the dropdown and choose an existing web page. Once you do that, click ‘Let’s Go!’.

The About option when embedding a form in an existing page

Then, you’ll be redirected to the WordPress block editor with WPForms instructions.

You can click the ‘Done’ button to hide these instructions.

The + button for adding a new block on the WordPress block editor

From here, you need to click the ‘+’ button to add a WPForms block.

Type ‘WPForms’ into the search bar. Then, you should see the WPForms block on the search results. Click to add it.

The WPForms block to add to the WordPress block editor

After adding the WPForms block, you’ll see a dropdown menu on your page.

Simply click on the dropdown and choose a form from the list. Let’s select ‘Contact Form’ since that’s the form we just made.

The Contact Form option in the WPForms' block's dropdown

Step 7: Publishing the Form

In this final stage, let’s preview the form before publishing to make sure everything looks perfect. In the WordPress block editor, click View » Preview in new tab.

The Preview in new tab button on the WordPress block editor

If you want, you can also preview how the form looks like on tablet and mobile devices. All you have to do is click View » Tablet or Mobile » Preview in new tab.

Finally, if no further adjustments are needed, hit ‘Update’.

The Update button on WordPress' block editor

Congratulations! You’ve successfully added your new contact form with dropdown fields on your WordPress website.

Here’s how it looked on our demo website:

A contact form with dropdown fields embedded on a WordPress website

We hope this guide has helped you learn how to create WordPress forms with dropdown fields. Next, you may want to learn how to use a contact form to grow your email list and our ultimate guide to using WordPress forms.

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.

The post How to Create WordPress Forms With Dropdown Fields (Easy Method) first appeared on WPBeginner.

]]>
https://www.wpbeginner.com/plugins/how-to-create-wordpress-forms-with-dropdown-fields-easy-method/feed/ 4