So I had a similar problem before, and it appeared to have been fixed for that site, which was on the legacy plugins, but now I'm having the same issue where I'm in the blog post archive text searching for a query and receiving results from posts that are other post types, but I'm using the current Toolset plugins with no legacy integration and my WordPress Archive view configuration is set to "Posts only".
This was my original topic on this matter: https://toolset.com/forums/topic/restrict-wordpress-archive-text-search-to-specific-post-type-with-relevanssi/
In my current example, seen here hidden link, I have four results that show up. Two of them are proper generic Posts, while two others are Pages (Consumer Drop-In and Programs as seen in screenshot1.png).
screenshot2.png shows my configuration, recommended initially as the solution in my original topic, and as you can see, they're all supposedly set to restrict the view results to "include Posts only".
Any help in this matter would be greatly appreciated. Thanks in advance!
Hi,
Thank you for contacting us and I'd be happy to assist.
I did some tests on my website with similar blog page archive and the settings to restrict the post type, worked as expected.
Looks like something specific to your website is involved. To troubleshoot this, I'll suggest the following steps:
1. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One.
If it's fixed, you can start adding the disabled items, one-by-one, to narrow down to a possible conflicting one.
2. In case the issue still persists, I'll need your permission to download a clone/snapshot of the website, to investigate this on a different server.
regards,
Waqar
It appears to only do this when Relevannsi is active (see attached), otherwise, with everything else active (sans Relevannsi) it filters to the specific post type like it's supposed to. This is what my original ticket was about, too, as we have been using Relevannsi for years.
Thank you for sharing this update.
In my tests earlier, I actually did tested with Relevannsi active, but couldn't reproduce this.
Can I download the website's clone/snapshot to troubleshoot this further?
Yes, please. Go right ahead.
Thank you for the permission and I've downloaded the latest duplicator package.
I'll perform some tests and will share the findings, as soon as this testing completes.
Thank you for your patience.
Thank you for waiting while I completed the testing on your website's clone.
While I was able to see the issue with the blog/posts page archive's search on your website's clone, it wasn't reproducible on a clean test website.
I've shared these details with the concerned team as an exception for further investigation and will keep you updated through this ticket.
Great, thank you. I appreciate it.
Thank you for waiting and I've received an update.
It turns out it is possible to show only the 'Posts' in the Home/Blog archive, by following these steps:
1. In the archive's 'Loops Selection' section use the edit button next to the 'Home/Blog' option.
2. From the modal window, select only the 'Pages' option, click apply, and let the archive save the settings in the background.
3. Next, repeat the same, but this time select only the 'Posts' option and save the archive settings.
You'll see that after these steps, when you'll perform the search, only the posts will keep showing.
This appears to have addressed the issue, as my tests are now filtering properly to Posts only, thank you. Did they provide any insight into why this might occur?
Don't have more specific details, but something like this can happen if settings for the post type haven't been saved before.
Changing and then resetting them, updates it properly in the database.
Okay, thank you. Appreciate the help. 🙂