Skip Navigation

[Resolved] Yoast SEO breaks Access control of CPT read access

This thread is resolved. Here is a description of the problem and solution.

Problem: After activating Yoast SEO, the Access Control settings for post read access are not being respected. Guest Users can view the contents of posts that should be restricted by Access.

Solution: Update to the latest version of Access to receive a fix for this issue.

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#919088

I'm using Access to require that a custom role ('member') be present before allowing read access to a custom page type ('Member Page'). WooCommerce Subscriptions sets the role. I set up a Layouts template as the default read-access error response. All of this worked fine until I enabled the free version of Yoast SEO. At that point, the Access restriction was ignored and guest users could view the content of Member Pages. Disabling Yoast restores the correct function.

I see this item in the current errata:

https://toolset.com/errata/error-layout-not-applied-yoast-active/

that could be related to what I'm observing, but it claims to be fixed in Access 2.4.4, and I'm already running that version. This issue:

https://toolset.com/errata/yoast-seo-plugin-overrides-access-rules/

could also be related, but isn't an exact match.

Are you aware of this interaction problem, and if so, do you have a suggested workaround?

#919285

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jerry

My first instinct on seeing that you are using WC Subscriptions is to double check how your users register on the site.

We have very specific requirements for that, described in this documentation, otherwise Access may not work correctly because it does not support multiple roles.

https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/how-to-use-the-woocommerce-subscriptions-plugin-with-toolset/

Can you confirm how your users register, and the roles they have (which you can see on back-end page that lists Users).

#919394

I read that documentation before setting up the site, and can confirm that I configured the feature as described. Multiple roles are not involved. This issue isn't with Subscriptions here. Everything worked as designed until Yoast SEO was enabled, and again works fine if I disable it. Indeed, one can demonstrate the effect without the involvement of Subscriptions at all.

As a demonstration: set up a custom post type and a custom role intended to permit read access to that type. Assign a Layouts template as the default no-read-access response for that content type. Using both a logged-out (guest) browser, and a browser logged into a test account without the custom role assigned, attempt to view a post created using the CPT. Both will be shown the no-read-access template, as they should. Manually assign the custom role to the test account and repeat. The guest will still see the template, but the test account will see the content. Again, this is the expected behavior. Enable Yoast SEO 7.7.1 or 7.7.2 and repeat. Both the guest and the test account will see the content, though the guest should not. Remove the custom role from the test account and repeat. Both the guest and the test account will again see the content, though neither should. Disable Yoast. The guest will once again see the template, and the test account will see the content, as intended.

#919935

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jerry, yes WC Subscriptions is a red herring, I was able to reproduce the problem with Yoast on a clean install.

We fixed a similar issue recently after Yoast made certain breaking changes, and it looks like it may have happened again.

I have escalated this so that it can be fully debugged, and we'll make whatever changes are required for it to work.

I'll keep you posted.

#919997

Thanks, Nigel. I'll look forward to the solution.

The fact that this has happened before makes me wonder whether it's likely to happen again, as Yoast clearly isn't testing against Toolset. I'd rather not encounter problems like this randomly on live sites in the future. Do you folks prefer/recommend a different SEO helper plugin for use with Toolset, or is Yoast as good a choice as any?

#920260

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jerry

To be fair to Yoast there are a huge constellation of plugins with which it may be paired on client sites and it would be impossible to test against them all.

It is a big enough job testing against your own product.

We test against other plugins where we have specific functionality that depends on them, so for our WooCommerce integration we, naturally, include testing with the current WooCommerce before we publish updates.

That still doesn't prevent issues occurring when they push updates, however, and there is little alternative but reacting to client reports of problems that occur and fixing as quickly as possible.

We don't have specific recommendations for alternative SEO plugins, and similar issues could arise with those from time to time.

It is the nature of the WordPress ecosystem I'm afraid.

#920261

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry, I set the wrong status, let me just set this back to escalated.

I'll let you know when there is a fix available.

#920666

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jerry

This is fixed internally. An update for Access is currently going through QA and should be released in a matter of days with this fix.

If you install the update and still find any issues let me know, although it has been tested with Yoast 7.7.3 so you shouldn't.

#920988

Thanks, Nigel (and dev team). I'll let you know how it works on this end once I get the update.

#921638

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Just to let you know we have a glitch in our system publishing the Access update (which is ready to go), we expect it to be resolved Monday, keep an eye out for an update notice.

#921830

Will do. Thanks, Nigel.

#922570

Hi, Access 2.5 is now available for download or as an automatic update. Please install the latest version and let me know if the problem is not completely resolved.

#922655

Update installed and tested, and the problem has indeed been resolved. Thank you for your quick and effective attention to this.