This guide covers:
- Problems With Finding Content Control Settings (3)
- My Restriction Isn’t Working the Way I Want (4)
- No Available Blocks Under the Block Manager
- Getting a “too many redirects” Error
- Advanced Troubleshooting (1)
- Issues Fixed in Version 2.0 (4)
Problems With Finding Content Control Settings
1. Do you have the latest plugin version installed, active, and updated?
2. Did you look for Content Control under the Settings menu on your admin dashboard?
Try looking under the Settings menu from your WordPress admin dashboard. Check out our full instructions for finding Content Control settings.
3. Do you see Block Controls when you select a block in the Gutenberg editor?
If you have Content Control version 2.0 (and above) and haven’t changed the default Block Manager settings, you’ll see the Block Controls section in the block editor Block settings area when you select a block.
The above shows the Block Controls settings for a Columns block
If you don’t see Block Controls for your block, make sure it’s turned on in the Block Manager settings. You’ll find the Block Manager under Content Control > Settings > Block Controls. Learn more about the Block Controls settings in our A Quick Tour of the Plugin Settings Tab guide.
My Restriction Isn’t Working the Way I Want
1. I restricted all my posts and pages, yet I can see them even when I’m logged out
The Usual Suspect: AND Versus OR
This is usually from using an AND between Content restriction rules (instead of OR). Let’s dig into the details.
You created a global restriction for logged-in visitors. In your content rules, you have If Content Is A Post AND If Content Is A Page.
But you can still view all posts and pages even when you’re logged out. That’s because your restriction is telling Content Control to protect content that is a post and is also a page (at the same time). Since content can only be either a post or a page, that restriction will never happen.
The fix: Change the AND to OR!
Make sure you click Save Restriction to save your changes. When you retest, you’ll now need to log in to see any post or page on your site. Woo hoo!
2. My Custom Denial Message doesn’t work on the Blog and Archive Pages
Right now, this is a known problem. If you try to protect your blog and archive pages with a custom message, you might see your custom message as an “excerpt” for your blog posts instead of on the page.
It’s because WordPress treats the blog and archive pages differently. This is something we plan to support as soon as it’s feasible. Hang tight 😌
Try protecting your Blog and Archive pages with an existing page instead.
3. Handling archives: If there’s 1 blog post that’s restricted, the entire blog index page gets replaced or redirects
Another known issue is when you choose to replace or redirect an archive for restricted posts. If one restricted post is on your blog page, your whole blog index page gets replaced or redirected. For example, if your blog page has 5 posts with no restrictions and 1 post with a restriction, you’ll get redirected.
We’re adding more controls so you can do things like choose to hide that post in a future release!
4. Enabling Block Controls doesn’t protect my blocks
After you turn on the Enable Controls toggle button, make sure you expand the User Rules settings. Expanding the User Rules settings makes sure your Block Controls are legit.
Click Publish or Update, and you should be good to go.
No Available Blocks Under the Block Manager
If you don’t see any available blocks under Content Control > Settings > Block Controls > Block Manager, it’s because:
- You just installed Content Control v2 for the first time.
- Have not edited any posts or pages in Gutenberg after you installed Content Control v2.
That means Content Control hasn’t seen (i.e., indexed) all the available blocks installed on your site yet.
The fix: Open a post or page in the block editor and reload the Content Control > Settings > Block Controls > Block Manager page.
Getting a “too many redirects” Error
If you set up a Redirect protection, there are some gotchas that’ll cause a “too many redirects” error. Let’s cover each one.
Take the following example. You want to redirect visitors to your homepage to log in before seeing any other pages.
You have the following Protection and Content settings in your global restriction:
1. Protection: Is set to Redirect. E.g., Protection > Redirect > Home Page
2. Content: Has a rule that includes the post or page you’re protection is redirecting to. E.g., Content > If Content Is A Page.
Now, you log out and visit a page on your site. Your page is taking a long time to load. In fact, your page never loads. Instead, you see the ERR_TOO_MANY_REDIRECTS message!
Why is the above setup a problem?
TL;DR: If you set up a Redirect protection and whatever you redirect to is actually protected itself, the browser gets stuck in an infinite loop and eventually gives up (hence the error). The fix is to exclude what you’re redirecting to. You can add “exclusions” to your rules in the Content settings of your global restriction.
Here’s a breakdown to understand what’s going on.
- All of your site’s pages (including the homepage) are restricted to only logged-in visitors.
- You’re not logged in and try to bring up a page.
- Content Control sees you need to log in before it can show you the page.
- Content Control also sees you have a redirect to your site’s homepage.
- Content Control tells the browser to bring up the site’s homepage.
- The sequence repeats from step 2.
- The browser senses an infinite loop and breaks the loop with an ERR_TOO_MANY_REDIRECTS message.
Another popular case that causes this error is when you have a custom login page and set up your restriction to have Protection: Redirect > Login & Back and Content: Content Is A Page rule.
How to avoid the “too many redirects” Error
You can exclude the page you’re redirecting to. Here are a couple of examples.
1. Exclude your homepage
If you want to redirect everyone to your homepage but also need to protect all your site pages, be sure to exclude your homepage. You can do that by adding an AND rule for If Content Is Not The Home Page.
2. Exclude your custom login page
Remember, if you use a custom login page, it counts as a page too. If you redirect to a custom login page and you need to protect all pages, make sure you exclude your custom login. You can do that by adding an AND rule for If Content Is Not A Selected Page. Select your custom login page to complete your exclusion rule.
Query Monitor Support
Starting with Content Control version 2.0.11, you can see basic restriction details right inside the Query Monitor plugin.
Follow these steps to open the Query Monitor Content Control panel.
1. Make sure you’re running Content Control version 2.0.11 or greater and Query Monitor is active
2. While logged in as an admin, bring up a post or page on the front end of your site
3. Hover over the Query Monitor stats on the admin toolbar and click Content Control
That’ll open the Query Monitor Content Control panel.
The Query Monitor Content Control panel
The panel shows you:
- If the Exclude administrators from being restricted setting is on or off.
- If the check_all_restrictions filter is on or off.
- Whether or not the WordPress main query is restricted and what the restriction is, if any.
- A list of all your active Global Restrictions according to which post/page they apply and whether or not your current login can view the content. For example, the screen capture above has 1 restriction called “My first Content Control restriction”. It applies to the “Sample Page”. The current logged-in user cannot view it.
Issues Fixed in Version 2.0
1. Shortcode logged_out=”0″ parameter problem
The logged_out shortcode parameter is optional. If you leave it out, it’ll default to logged_out=”0″ behind the scenes.
In version 1.*, if you added logged_out=”0″ just to be more explicit, the whole shortcode didn’t work (your content wasn’t protected).
We fixed this problem in version 2.0. Here’s a shortcode example that works in version 2.0 but not in version 1.*.
[content_control roles="subscriber,editor" logged_out="0" class="custom-css-class" message="Log in as a subscriber or editor to check this out."]SUCCESS! Logged in content for subscribers and editors.[/content_control]
Learn more about the Content Control shortcode in our How To Use the Content Control Shortcode guide.
2. I get a “The preview could not be loaded” when I try to edit with Elementor
Let’s say you have an Elementor post or page with a restriction that allows only subscribers to view it.
If you still had Content Control version 1.*, and logged in as an admin, you’d get “The preview could not be loaded …” when trying to edit that post or page in Elementor.
That’s because Elementor uses a live preview and Content Control sees you as an admin trying to view content restricted to subscribers.
This was a problem in version 1.*. It’s fixed in version 2. Make sure you upgrade to version 2!
3. Content Control protects my content when using the Divi Visual Builder
This is similar to the Elementor problem.
Since Divi uses a live preview in its Visual Builder, your restrictions will protect your content just like when you view your content from the front end.
For example, if you use the Divi Visual Builder to edit a post or page that’s restricted to only subscribers, you’ll need to log in as a subscriber before you can edit it. I.e., if you’re logged in as an administrator, you can’t edit Divi posts/pages for subscribers until you log out and log in as a subscriber.
This problem is also fixed in version 2.*. All you need to do is upgrade to version 2!
4. My top restrictions stop or “short-circuit” ones lower in the restriction list
The restrictions at the top of the Global Restrictions list have a higher priority than the ones lower in the list. Every time your site serves up content, Content Control checks that content against your global restrictions starting at the top of the list.
In version 1.*, once Content Control ran or applied a restriction, it would stop checking the list (short-circuit). Restrictions after the one that fired (lower in the list) were ignored.
In version 2, restrictions at the top of the list still have higher priority. But now you can use a PHP hook to tell Content Control to check and enforce all global restrictions in your list. Here’s the filter you need to add to your site.
add_filter( 'content_control/check_all_restrictions', '__return_true' );
Read Getting Started With Custom PHP to learn how to add this WordPress filter to your website.