Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search for quoted phrase on mobile
- This topic has 8 replies, 2 voices, and was last updated 3 months, 3 weeks ago by
Steve Strutt.
-
AuthorPosts
-
February 5, 2026 at 3:06 pm #56938
Steve Strutt
ParticipantHi Ernest, I like the styling of the new Search Statistics pages and the filter options, especially having the results sorting option. Exactly what I need.
I am experiensing odd behaviour on mobile devices and ended up using the search statistics to capture the results. I have switched back to using the regular engine, as I had a user request for search by phrase, which is not supported in the index engine. I changed back to the regular search engine and search by phrase, e.g. “Red Cow”, works and returns 62 results on my desktop. All good.
However the same search “Red Cow” on a mobile iPhone or iPad with either Safari or Chrome returns 0 results. This can be seen in the search statistics screenshot below. All the all searches on a mobile, once the first “followed by any characters, result in 0 hits. The incorrect results only appear on mobile devices.
February 6, 2026 at 11:06 am #56944Ernest Marcinko
KeymasterHi Steve!
May I test this somewhere? The search results should be the same on all devices – unless something is either conflicting or there is an unknown bug. If I can test it, I might see something in the network debug tool.
Thank you!
February 6, 2026 at 11:43 am #56945Steve Strutt
ParticipantHi Ernest, the website is at https://swop-demo.co.uk, though I have spotted the problem. On the phone the search URL is constructed as:
https://swop-demo.co.uk/?s=“Red+cow” with double quotes. It works when the ” is replaced with %22.On my Mac the RUL is constructed as:
https://swop-demo.co.uk/?s=%22Red+Cow%22 with %22On my iphone with the zero results, the returned search URI is:
https://swop-demo.co.uk/?s=”Red+Cow”&asp_active=1&p_asid=3&p_asp_data=1&aspf%5Bsearch_date__6%5D%5Bupper%5D=&aspf%5Bsearch_date__6%5D%5Blower%5D=&device=3&filters_initial=1&filters_changed=0&qtranslate_lang=0&asp_highlight=1¤t_page_id=-1If I construct the search URL myself on my phone, it works and I get the expected 62 results.
https://swop-demo.co.uk/?s=%22Red+Cow%22The full working URL being:
https://swop-demo.co.uk/?s=%22Red+Cow%22&asp_active=1&p_asid=3&p_asp_data=1&aspf%5Bsearch_date__6%5D%5Bupper%5D=&aspf%5Bsearch_date__6%5D%5Blower%5D=&device=3&filters_initial=1&filters_changed=0&qtranslate_lang=0&asp_highlight=1¤t_page_id=-1It looks like the searchtext input field on mobile behaves differently to on the Mac.
February 6, 2026 at 12:04 pm #56946Ernest Marcinko
KeymasterOh I see the issue there. It’s because the quotation marks are the curly double version. It’s super rare, but I suspect that specific keyboard layout is using that instead of the non-curly version.
Luckily this can be resolved very easily with a code snippet, so that it’s replaced to the non-curly version during processing.
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
/** * Replace all different curly double quotation marks with the unified '"' double quote */ add_filter( 'asp_query_args', function ( $args ) { $characters = '“”'; $replace_with = '"'; $args['s'] = str_replace(str_split($characters), $replace_with, $args['s']); return $args; } );It is intentionally not replace in the plugin code, as we had a couple of requests a few years back, where people needed to be able to search these quotation marks within text, so the standard non-curly version is used for the exact matching purpose. The code snippet above should resolve that.
February 6, 2026 at 1:41 pm #56947Steve Strutt
ParticipantUgh, I hate “ and “. Never try copying from a Word document to VSCode. I wondered if it was related to using UK or US keyboards, but I get the same problem on my iphone, using the UK or US keyboards. The touch, or bluetooth keyboard on the iphone and ipad defaults to curly double brackets when entering text into the search field using the ASP shortcode. But using a long touch and selecting the type of double bracket, the default then is straight double quotes and the search works.
The problem is an iOS default since 2017 and is mobile-specific due to rich text on mobile keypads. On the iphone and iPad, the ASP search text input field is supoporting rich text with emojis et al. The issue appears to be as a result of a new feature in iOS 11, Smart Punctuation, that automatically turns straight into double quotes. This has been the default since 2017!
If the url is typed directly into the URL field of Safari, the double quote is interpreted as straight as rich text is not supported as it has to be a url safe field.
The solution does not look to be obvious, though I wonder if the problem stems from the earlier fix, which now with mobiles supporting rich text input and smart punctuation as default, is showing up this latent issue. A majority of mobile users so not need rich text input and like me were expecting the input behaviour to be similar across desktop and mobile. One of the challenges of creating websites that work across mobile and desktop. The behaviour that ASP wants goes against the defaults of iOS. The direction Apple are traveling in with the merger of iOS and MacOS, iPad Pro etc will likely make it visible to more users.
I will put the patch in and at the same time it would be good to add this to the ASP knowledge base. A more nuanced solution would be good to support iOS.
Regards Steve
February 6, 2026 at 2:15 pm #56948Ernest Marcinko
KeymasterThe problem is an iOS default since 2017 and is mobile-specific due to rich text on mobile keypads. On the iphone and iPad, the ASP search text input field is supoporting rich text with emojis et al. The issue appears to be as a result of a new feature in iOS 11, Smart Punctuation, that automatically turns straight into double quotes. This has been the default since 2017!
That could be it actually. I am also using Mac and an Iphone, but I suspect that it’s either not enabled on my end, or it is different by region. No matter what I do, I always get the “normal” double quotes.
Either way, I will look into this in more detail and update the knowledge base soon with this addition.
February 6, 2026 at 2:42 pm #56949Steve Strutt
ParticipantThe problem is more than double quotes, it also affects quotation marks on iOS. While out I wanted to look up something on our website and couldn’t find it.
I was looking for >> John’s << with a straight single quote in it. By default iOS changed it to John’s, which made me initially think there were no hits. It took a while to realise it was the same Smart Punctuation issue. This editor dialog is misdisplaying the single quotes!
Maybe not many people are searching using ASP on iOS devices. With Chrome or Safari on iOS, Google.com doesn’t get the same problem. Suggesting there is a way to turn of Smart Punctuation in the text input field.
-
This reply was modified 3 months, 3 weeks ago by
Steve Strutt.
-
This reply was modified 3 months, 3 weeks ago by
Steve Strutt.
February 10, 2026 at 12:28 pm #56960Ernest Marcinko
KeymasterAfter some consideration I have decided to add a back-end option for this in the next release, I have opened an issue on the tracker here.
This will allow a super easy fix for you, as well as for anyone who prefers it this way.February 10, 2026 at 9:38 pm #56964Steve Strutt
ParticipantThanks.
-
This reply was modified 3 months, 3 weeks ago by
-
AuthorPosts
- You must be logged in to reply to this topic.