-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent indexing when blog is deleted or not public #1163
Conversation
…ic to prevent posts from getting indexed if blog is not indexable. Fixes #1157.
Hi @allan23 , I got posts to index without any issues and only sites that were in the public category get their posts indexed. However, these changes are also breaking creating a new post for me on any site, with this error: These are my test sites: Individual settings for each site: Steps to reproduce: 1.- Edit site settings and set them to deleted/archived/non-public but the main one |
@oscarssanchez thank you for testing. I've made corrections in the latest commit. Can you please retest? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @allan23 ,
This is working flawless for me now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not addressing the wp_get_sites() portion of the logic which was deprecated around wp 2.6
ElasticPress/classes/class-ep-api.php
Line 2027 in 0e8d822
$sites = wp_get_sites( $args ); |
We also need to create a follow-up ticket to this to address the edge case of mature blogs as we need to ensure mature content will not be shown by default on a non-mature site.
Overall looks good to me
Add additional hook for when an blog is deleted. Also conditional logic to prevent posts from getting indexed if blog is not indexable.