How to Require Login to View a Page in WordPress (2 Easy Ways)

How to Require Login to View a Page in WordPress (2 Easy Ways)

“How do I make this web page non-public for members solely?” That’s one of the widespread questions I get requested by my mates who use WP. I bear in mind asking the identical query myself after we have been constructing our video membership web site at WPBeginner.

Fortunately, it’s surprisingly simple to limit web page entry to logged-in customers in WP. You don’t want to rent a developer or be taught complicated coding. So long as you might have the proper plugin, you may set all of it up in virtually no time.

After serving to totally different web site homeowners clear up this actual downside, I’ve narrowed it all the way down to 2 foolproof strategies that work for any WP web site. Let me present you the best way to make WP login required to view a web page and even your whole web site.

Require Login to View a Page in WordPressRequire Login to View a Page in WordPress
How to Require Login to View a Page in WordPress (2 Easy Ways) 1

When Ought to You Require Customers to Log In to View a Section?

Not each web page in your web site must be locked, however in some circumstances, requiring customers to log in is the easiest way to guard your content material.

Listed here are a number of conditions the place requiring person login is a good suggestion:

  • Membership Websites & On-line Programs – If you happen to provide unique content material, tutorials, or coaching supplies, then requiring a login ensures solely paying members can entry your premium content material.
  • Personal Consumer Portals – If you’re sharing confidential paperwork, mission updates, or invoices in shopper portals, then proscribing entry retains delicate info safe.
  • Unique Weblog Text – Some web sites provide premium articles, guides, or analysis reviews to registered customers or subscribers solely. This might help develop your e-mail listing and increase engagement.
  • Neighborhood Boards & Dialogue Boards – If you happen to run a members-only discussion board, then requiring login helps preserve the dialog non-public and related to your viewers.
  • Firm Intranet & Crew Sources – Companies usually use WP to share inside paperwork, coaching supplies, or bulletins with staff. Requiring login for entry retains this info safe.

If any of those apply to your web site, then organising a login requirement is a great transfer.

Now, let’s check out 2 simple methods to require login to view a web page in WP. I’ll present you ways to do that with each particular pages and all pages.

You need to use the short hyperlinks beneath to leap to the tactic you need to use:

Methodology 1: Require Login to View a Section in WP With MemberPress (For Particular Pages & Posts)

If you happen to’re in search of a straightforward and highly effective method to prohibit entry to particular pages or posts, then MemberPress is a good alternative.

With MemberPress, you may simply management who will get entry to your content material, whether or not it’s for members, subscribers, or paying clients. It permits you to create a strong membership web site that matches your particular wants.

For my part, it’s the very best content material safety plugin for WP. It makes it tremendous easy to require customers to log in earlier than viewing a web page.

At WPBeginner, we used MemberPress to create our free video membership web site the place solely subscribers can entry the teachings. For particulars, see this information on how WPBeginner makes use of a free video membership web site to develop our e-mail listing.

Now, to get began, you’ll want to put in and activate the MemberPress plugin. For step-by-step directions, see our tutorial on the best way to set up a WP plugin.

READ  White Labeling Ecommerce Explained for Beginners

When you’ve activated the plugin, head over to the MemberPress » Settings web page to enter your license key. You may get this info in your account space on the MemberPress web site.

Adding a license key to your MemberPress pluginAdding a license key to your MemberPress plugin
How to Require Login to View a Page in WordPress (2 Easy Ways) 2

Then, you’ll want to swap to the ‘Funds’ tab so as to add a fee gateway. The plugin comes with built-in help for PayPal and Stripe.

Go forward and click on the ‘+ Add Cost Methodology’ button and select the gateway of your alternative. If you happen to want step-by-step directions, see this tutorial on the best way to settle for Stripe funds in WP.

Adding payment methods to a pay-per-view websiteAdding payment methods to a pay-per-view website
How to Require Login to View a Page in WordPress (2 Easy Ways) 3

Upon getting arrange your fee strategies, you will have to create totally different membership ranges. With every membership, you may specify the extent of entry a person has for viewing restricted content material.

To get began, go to the MemberPress » Memberships web page from the WP admin panel and click on the ‘Add New’ button.

Adding membership levels to your WordPress websiteAdding membership levels to your WordPress website
How to Require Login to View a Page in WordPress (2 Easy Ways) 4

This can open the membership editor, the place you’ll want so as to add a reputation and outline to your membership.

Then, set the worth and expiration to your membership plan. As an example, you may choose the billing sort as recurring or one-time and select the interval to be yearly, month-to-month, weekly, or customized.

Creating a paid membership subscription using MemberPressCreating a paid membership subscription using MemberPress
How to Require Login to View a Page in WordPress (2 Easy Ways) 5

If you’re new to utilizing MemberPress, then you may try WPBeginner’s final information to making a membership web site for extra directions.

After you’re completely happy along with your membership plan, click on the ‘Publish’ button to retailer your settings. Now you can repeat the method so as to add as many membership ranges as you want.

Subsequent, you need to prohibit entry to your content material in order that solely logged-in customers can view it. To do that, head over to the MemberPress » Guidelines web page from the WP dashboard.

Right here, click on on the ‘Add New’ button on the prime.

Adding a new rule to your WordPress membership siteAdding a new rule to your WordPress membership site
How to Require Login to View a Page in WordPress (2 Easy Ways) 6

This can take you to a brand new display screen, the place you need to select the ‘A Single Section’ choice from the ‘Protected Text’ dropdown menu.

Subsequent, enter the slug (URL) of the web page the place you need to require customers to log in earlier than having the ability to view the content material.

Choose content to protect from the dropdown menuChoose content to protect from the dropdown menu
How to Require Login to View a Page in WordPress (2 Easy Ways) 7

Word: Though utilizing MemberPress is good for having granular management over restricted content material, you too can select the ‘All Pages’ choice from the dropdown menu to require WP login for all pages in your web site.

Now, you’ll want to set a situation for the sort of members who can view this web page.

To do that, choose ‘Member’ from the dropdown menu and sort ‘logged in’ within the discipline subsequent to it. Because of this anybody with the Member person function can entry this content material as soon as they log in.

Configure access conditionConfigure access condition
How to Require Login to View a Page in WordPress (2 Easy Ways) 8

After that, scroll all the way down to the ‘Unauthorized Entry’ part and select the ‘Present’ choice for the login kind from the dropdown.

Then, click on the ‘Save Rule’ and ‘Publish’ buttons on the prime.

Choose the Show option for the login formChoose the Show option for the login form
How to Require Login to View a Page in WordPress (2 Easy Ways) 9

At this level, you’ll have to create the login web page that customers will see once they attempt to entry your restricted content material.

To do that, head over to Pages » Add New Section from the WP admin sidebar.

This can open the block editor, the place you may customise the web page. As soon as right here, I like to recommend giving the web page a descriptive title, like ‘Unauthorized’ or ‘Login Right here,’ to make it clear to customers why they’re seeing the web page.

READ  8 Best WooCommerce Affiliate Plugins Compared (Tried and Tested)

Under the title, you may also need to add a easy message like “You can’t view this web page since you haven’t logged in.”

Subsequent, click on the ‘Add Block’ (+) button and select the ‘Login Type’ block.

Add login form blockAdd login form block
How to Require Login to View a Page in WordPress (2 Easy Ways) 10

Questioning the place this helpful block got here from? MemberPress creates it mechanically, so that you don’t should. That is simply one other perk of utilizing the plugin.

Including the login kind right here permits customers to check in rapidly to allow them to view your unique web page.

When you’ve added the login block to your web page, I extremely suggest together with a hyperlink to your primary signup or pricing web page utilizing the hyperlink icon within the toolbar. This provides guests a transparent subsequent step in the event that they’re not members but.

You’ll be able to add a brief, pleasant message together with the hyperlink to encourage signups — one thing like: “New right here? Go to our Signal Up Section to decide on your membership plan.”

Add sign up page linkAdd sign up page link
How to Require Login to View a Page in WordPress (2 Easy Ways) 11

Be certain your message is evident, inviting, and matches the tone of the positioning. If you happen to’re unsure the best way to insert a hyperlink, see our step-by-step tutorial on the best way to add a hyperlink in WP.

Then, once you’re completely happy along with your modifications, click on the ‘Publish’ button within the prime proper nook of your editor to make your login web page dwell.

Now, copy the URL of your new login web page. You’ll want it in a second.

💡 Haven’t created your signup web page but? Take a look at our in-depth MemberPress evaluate to be taught extra concerning the plugin’s built-in registration options and the way they will prevent time.

Go to MemberPress » Settings » Pages out of your admin sidebar and scroll all the way down to the ‘Unauthorized Entry’ part.

Now, merely test the ‘Redirect unauthorized guests to a particular URL’ choice.

Add URL for the unauthorized pageAdd URL for the unauthorized page
How to Require Login to View a Page in WordPress (2 Easy Ways) 12

Then, add the URL for the revealed web page that you just copied earlier and click on the ‘Replace Choices’ button to save lots of your modifications.

Now, when customers attempt to go to your web page with unique content material with out logging in, they are going to be mechanically redirected to the ‘Unauthorized’ web page.

Right here, they will log in to view the locked content material on this web page.

Login page previewLogin page preview
How to Require Login to View a Page in WordPress (2 Easy Ways) 13

If a brand new customer lands on this web page, they will merely click on the signup hyperlink to be taken on to your registration or membership plans web page.

Now that your ‘Unauthorized’ web page is ready up with clear login and signup hyperlinks, it’s simple for guests to take motion — whether or not they’re returning customers or new to your web site.

However what if you wish to go a step additional and provides new guests a glimpse of what they’re lacking in the event that they don’t enroll? That’s the place MemberPress actually shines.

It enables you to transcend merely locking pages. You’ll be able to really present a snippet or preview of your content material utilizing the Excerpts function.

Creating a custom unauthorized access message for your membership siteCreating a custom unauthorized access message for your membership site
How to Require Login to View a Page in WordPress (2 Easy Ways) 14

That is excellent for teasing weblog posts, classes, or gated assets.

For instance, you may show the primary few paragraphs of an article to everybody, however then immediate them to register or improve their plan to proceed studying.

READ  11 Best eCommerce Solutions Growing in Popularity in 2024

This method not solely improves person expertise however can even increase your conversions since guests get to see the worth of your content material earlier than signing up.

For extra details about this function, see our information on the best way to create paywall choices in WP (with preview choices).

Different: Whereas I extremely suggest MemberPress, there are different choices for creating members-only content material. For extra suggestions, see my knowledgeable choose of the very best WP membership plugins.

Methodology 2: Require Login to View All Pages in WP With My Personal Web site (For All Pages & Posts)

If you’re in search of a free and easy method to prohibit entry to your whole web site, then utilizing My Personal Web site is a good choice.

This free plugin locks down your WP web site, requiring customers to log in earlier than they will view any web page. Nonetheless, take into account that it doesn’t will let you select which pages you need to make non-public, so it received’t be appropriate except you need to require login to your whole web site.

First, you’ll want to set up and activate the My Personal Web site plugin. For particulars, see this tutorial on the best way to set up a WP plugin.

After you activate the plugin, you’ll want to head over to the My Personal Web site » Web site Privateness web page from the WP dashboard and test the ‘Allow login privateness’ field.

Enable login privacyEnable login privacy
How to Require Login to View a Page in WordPress (2 Easy Ways) 15

Then, click on the ‘Save Privateness Standing’ button to retailer your modifications. Now, customers might want to log in to view any web page in your web site.

Subsequent, go to the ‘Touchdown Section’ part. That is the place you resolve the place customers needs to be redirected after they log in.

You’ll be able to select to return them to the identical URL, in order that they land again on the web page they have been making an attempt to entry, or you may redirect them to the house web page. You may also ship customers to the WP dashboard after they log in.

If none of these choices be just right for you, then you may set a customized URL as a substitute. This fashion, you may redirect customers to a particular web page, like a welcome web page or members-only content material space.

Be certain to click on the ‘Save Touchdown Section’ button to retailer your modifications.

Choose the landing page where logged in users will be redirectedChoose the landing page where logged in users will be redirected
How to Require Login to View a Page in WordPress (2 Easy Ways) 16

After that, swap to the ‘Dwelling Section’ tab.

Right here, you may test the ‘Permit web site residence web page to stay accessible with out requiring login’ field if you’d like the house web page to stay accessible to everybody.

Then, click on the ‘Make Section Public’ button.

Allow home page to be accessible for everyoneAllow home page to be accessible for everyone
How to Require Login to View a Page in WordPress (2 Easy Ways) 17

Now, once you go to your web site, your property web page can be seen to everybody.

Nonetheless, when customers attempt to entry some other web page with out logging in, they are going to be taken to the default WP login web page, the place they will add their particulars.

WordPress Login ScreenWordPress Login Screen
How to Require Login to View a Page in WordPress (2 Easy Ways) 18

On the lookout for extra suggestions and tips to handle your membership web site or person login pages? Take a look at these helpful guides beneath:

If you happen to appreciated this text, then please subscribe to our YouTube Channel for WP video tutorials. You may also discover us on Twitter and Fb.

Leave a Reply

Your email address will not be published. Required fields are marked *