Navigation überspringen

[Gelöst] Restrict WordPress Archive Text Search to Specific Post Type (Again)

This support ticket is created vor 1 Jahr, 1 Monat. 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Dieses Thema enthält 10 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Waqar vor 1 Jahr.

Assistiert von: Waqar.

Author
Artikel
#2667005
screenshot2.png
screenshot1.png

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 versteckter 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!

#2667101

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

#2667337
screenshot.jpg

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.

#2667583

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?

#2669407

Yes, please. Go right ahead.

#2669935

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.

#2670809

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.

#2671463

Great, thank you. I appreciate it.

#2672503

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.

#2673035

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?

#2673149

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.

#2673539

Okay, thank you. Appreciate the help. 🙂