Your content is great, and you spend a lot of time creating it. So why in the world would you want to limit access and restrict areas of your WordPress site to only certain folks? Well, lots of reasons, actually. You may host confidential data that may need to be password protected, various documents that you don’t want indexed by search engines, and/or service upgrades and premium content that you sell to make your living. Regardless of the reasoning behind restricting access, there are a couple of ways you can handle doing it.
There’s a good chance that you already subscribe or have subscribed to any number of services that restrict content. If you’re an Elegant Themes member, Divi and our plugins are restricted behind your membership credentials. Lynda.com and Team Treehouse, maybe? Or if you support any one on Patreon, there is likely content restricted there.
It may sound harsh, but it’s really not. It’s all a part of the SaaS (software as a service) model.
How Things Usually Work
In general, the flow of a restricted content is the same across the board:
- Users visit the website, browse the content offerings, and decide if they want to buy a plan.
- They can then click the CTA (probably a big button that says Become a Member or something similar) in the header area or down lower on the squeeze page.
- From there, users are generally presented with tiers of plans to select from. They pick one, put in their information, and create an account.
- They can then log into that account to get access to the restricted areas of the website where all the stuff they paid for lives.
The beauty of WordPress is that you can do all of this with a few shortcodes or plugins. Some amazing developers out there have created some really nice ways to lock down your site, so setting it all up is about as simple as it can be.
Restricting Access to Your WordPress Site with a Plugin
One of your best options to restrict content is a plugin called Members. Not only is it free, but it allows you to restrict content, admin access, and other capabilities. It also has premium options that make it scale to accommodate more complex projects.
Upon installation, you will see a new menu option at Settings – Members. There are quite a few options in here, so I’m gonna break it up a little.
This is the top half of the options screen. Generally, you will leave all of the boxes checked (default) because they give you the largest breadth of actually controlling how you restrict access to your content. However, you do want to make sure to customize the Error Message box — a little personalization goes a long way when you’re telling people no. (Just ask any writer who has ever submitted their writing anywhere.)
This is also a great place to add in a call to action, leading anyone who does not have access to your Become a Member page.
The second half of the options, though, have a few things you will want to consider. The Sidebar Widgets come disabled by default, but it may be a good idea to enable them just to give you the option for more customization.
Now, the Private Site option is a little more complicated. It locks down your entire WordPress installation as being private. This can be good or bad, really. It means they can’t even see a landing page beforehand, so it needs to be done for a reason. Or you may have your member’s content on a secondary WordPress installation.
For example, we have elegantthemes.com as one site, and technically elegantthemes.com/blog is a WordPress installation in a subdirectory. Enabling the private site option for us would mean only the content under /blog would be protected. Not the root URL.
Additionally, you can hit the Add-ons tab to see what premium extensions you can buy to expand the capabilities of the plugin.
Actually Restricting Your Content
When you get down to it, the reason that Members is such a great plugin is that you have a very simple method of restricting your WordPress content. When you go into any post or page on your site (either new or published), there will be a new metabox under the content called Content Permission.
All you have to do is assign which user roles on your site get access to the content. Otherwise, they get the restricted message. Additionally, if you need to customize the message they receive on a page-by-page basis, you can do so in the Error Message tab. Otherwise, the message in the plugin options is displayed.
Do keep in mind that when you use this method, that (depending on your theme, of course) people can still see the meta information, title, and featured image of your post.
Part of Members is that you can edit the users on your site as well. Not only can you restrict the content, but you can also grant or restrict permissions, too under Users – Roles.
With this, you can set who can view and edit what content on the site. It’s incredibly powerful, and lets you fully control what content anyone can see. By controlling what access people have on the backend, you can effectively restrict even admin content on a granular level.
The Elegant Themes “Protected” Shortcode
Now the Members plugin is one way to do it. If you’re an Elegant Themes member, you can restrict access to any part of your WordPress site with a shortcode. Meet the Protected shortcode. For a quick example, I put a sentence in a blog post inside the shortcodes:
[protected] This content is protected by the Elegant Themes Protected shortcode![/protected]
Nothing too special but more than enough to illustrate the nice feature. Since I am logged in, the content displays on the page when I view it.
But when a user who is not logged in visits, all they get is the protected version, which displays a prompt for them to log into the site to see whatever is being protected by the shortcode. This is a great feature to use for data, digital goods, or more in which you would like to only give access to certain users, and it comes default in Divi and Extra.
Granting access to users of your site seems like a daunting process at first. However, the WordPress community makes it pretty simple — like they do most things. Restricting access to your site is great if you need to keep sensitive data private, run a shop that distributes digital goods, or really, doing anything else to make some income online.
Do you currently restrict access to parts of your website? Tells us your ideas and methods in doing so in the comments!
feature image via shutterstock author Best3d