Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 6 replies, has 2 voices.

Last updated by Waqar Ali 1 year, 3 months ago.

Assisted by: Waqar Ali.

Author Posts
March 6, 2024 at 4:51 pm #15380893

danielaK-6

Hi WPML support!

WHEN I enable plugin "WPML String Translation" and use the search functionality on my website (e. g. search term "team")
THEN WordPress native search shows: 0 Search Results for: ""

WHEN I disable plugin "WPML String Translation" and search term "team" (example)
THEN WordPress native search shows: 251 Search Results for: "team"

Here is the search code from header.php file:
<form role="search" method="get" id="searchform1" class="form form-search hidden-xs hidden-sm" action="<?php echo home_url(); ?>">
<div class="form-group has-clear">
<label class="sr-only" for="s1">Suchen</label>
<input value="" name="s" type="text" class="form-control" id="s1" placeholder="<?php _e('Search','hnp') ?>">
<span class="form-control-clear hidden"></span>
<button id="searchsubmit1" type="submit" class="btn-search"><span class="sr-only">Suchen</span></button>
</div>
</form>

Do you have any suggestions what's may be the problem?

March 7, 2024 at 7:36 am #15382414

Waqar Ali

Hi,

Thank you for contacting us and I'd be happy to assist.

Can you please turn on WordPress debugging and see if any errors or warnings are shown in the log when the search returns no results?
( ref: https://wpml.org/documentation/support/debugging-wpml/ )

In case there are none, you're welcome to share temporary admin login details, for further troubleshooting.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

March 8, 2024 at 3:01 pm #15389942

Waqar Ali

Hi Daniela,

The access details worked, thank you.

During initial troubleshooting, I couldn't narrow down what exactly is causing this.

Do I have your permission to download a clone/snapshot of this website, to investigate this on a different server?

regards,
Waqar

March 11, 2024 at 9:35 am #15393904

danielaK-6

Dear Waqar!

Of course you can download a copy of the dev-installation where I provided you the access.

Best regards,
Daniela

March 11, 2024 at 2:50 pm #15396095

Waqar Ali

Thank you for the permission.

During troubleshooting on your website's clone, I found that a string translation entry was added to translate 's' to 'b'.

The 's' is a reserved text that is used by the WordPress default search functionality and due to this translation entry, the search gets broken.

Please go to WP Admin -> WPML -> String Translations, and search for this translation entry for 's', and delete it, as shown in the attached screenshot.

string-translation-screenshot.png
March 11, 2024 at 3:04 pm #15396203

danielaK-6

Thank you very much for your help, dear Waqar. So this caused the problem.

I used the 'b' string as custom post type slug for custom post type "branchen". So that cpt-detail page URL structure is shorter e. g. https:/websiteurl.com/b/abfallwirtschaft/.
The EN translation of this ctp string is 's'. But of course I was not aware that 's' is reserved for WordPress search.

My issue is resolved now. Thanks again.

March 12, 2024 at 5:24 am #15397709

Waqar Ali

You're very welcome and glad I could help.

Please feel free to mark this ticket as resolved and start a new one, for each new question or concern.