Reasons for the "You are not allowed to view this content." message
GravityView has many levels of security in place to make sure that your content is visible only when you want it to be. If you see the notification "You are not allowed to view this content.", there are multiple reasons why this might happen.
To determine why you cannot access a View or entry, enable logging and reload the page. You should see a line in the log with a message similar to "Entry ID #{entry_id} is not active" because the content is not accessible.
Some possible reasons why the message is displayed:
- Prevent Direct Access setting is enabled for a View, and you're attempting to visit the View, not the post or a page where it is embedded.
- Does the URL have "/view/" in it? if so, this counts as "direct access", and is likely the issue. To fix:
- Edit the View
- Scroll down to View Settings
- If checked, uncheck the setting "Prevent Direct Access", and save the View
- If unchecked: have you modified the code using the `gravityview_direct_access` filter? If not, "Direct Access" is not the reason you see the error.
- Does the URL have "/view/" in it? if so, this counts as "direct access", and is likely the issue. To fix:
- The entry you are attempting to access has been put in the "trash" in the Gravity Forms
- Custom entry URL slugs are enabled, and the URL "slug" and entry details don't match
- The View is configured only to show approved entries, and the current entry is not approved
- The current search parameters (or Advanced Filters settings) prevent the entry from being displayed
- You are attempting to access the REST API, and REST API is not enabled (or is disabled specifically) for the View
- The View is privately published, and you don't have access to reading it
- If you are running the Avada theme and have the [gravityview] shortcode inside a "Code" field. Instead, place the shortcode in a Text field.