Search results template not being used consistently

I have created an Archive Layout template. I set the Assignment Conditions to “Search Results” “is being viewed” and the “Priority” is 0.

I have a Search element in my site header.

When a visitor searches using that Search element, sometimes the results take them to a page using the Search Results template, and sometimes it doesn’t. It seems to depend on the search term!

I do not have any other Archive templates tied to the Search Results condition.

Why would this happen / how can I fix it?

Hello @dannikb,

Thanks for writing to us.

In order to help you with your concerns, we need to check your settings. I would request please share the admin login details meanwhile I would suggest you troubleshoot a few of the common issues before we investigate your settings. Please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact page URL

You can find the Secure Note button at the bottom of your posts

Thanks

Sorry for the delay. I needed to get a Staging site setup to do some testing. Now that I have that, I’ll provide credentials via the Secure Note.

I did identify the source of the conflict, I think. I disabled all plugins and search worked fine. I then re-enabled one by one and found the issue re-appeared once Advanced Custom Fields Pro was enabled. On the staging site, I updated to the latest theme, which brought ACF to its latest version, but the issue persisted.

Hello @dannikb,

I’ve checked your site and the search results layout and features work correctly on my end using Google Chrome version 145.0.7632.160. This issue is typically caused by caching—please purge all caches from your site, plugins, and browser, then test again.

Thanks

Hello, did you run the particular searches I suggested? It only seems to happen with certain search terms. I’ve tried this on multiple devices, different browsers, and after clearing all the cache so I don’t think that’s the issue.

Hey Danni,

Edit your Search Result archive layout and set a -1 priority.

This should force the layout to be used with search.

Kindly let us know how it goes.

That seemed to fix the issue! (I didn’t realize you could go negative on the priority, so thank you.) However, any idea why that was necessary? That was the only archive template assigned to search results.

Hello Danni,

This issue typically occurs due to aggressive caching. Set the priority to -1 (higher priority) to ensure the layout renders correctly.

Thanks