【WordPress】mobile search form not working 搜尋框 forbidden

【WordPress】mobile search form not working 搜尋框 forbidden

在桌面上瀏覽時,網站內的搜尋是能如常運作,然而在手機上使用站內搜尋時,卻得出 “forbidden” 的頁面。(The website appears “forbidden” page when using mobile search form, but the search form works fine in desktop mode.)

forbidden page when enabling search in wordpress website
手機上使用搜尋功能時,得出 “forbidden” 畫面

會造成這個情況,離不開網站內已安裝的 themes 和 plugins 相關,若兩者不相容,那就容易得出錯誤頁面。當然,有時候是自己(管理員)設定錯誤而導致這結果。

If installed theme is not compatible with newly installed plugins, or installed plugins are contradicting each other, it may cause an error page. (Of course, it is probable that the user(admin) had set wrong setting mistakenly.)

而今次找出導致 search form 不能正常使用的是 CleanTalk plugin,在 Anti-Spam by CleanTalk 的 plugin 上,按下 “Advanced settings”,然後把 Test default WordPress search form for spam 關掉 (turn off)。儲存更改後,應可在手機上順利使用 search box 搜尋站內結果。

One solution is going to dashboard, find “Anti-Spam by CleanTalk” plugin->Advanced settings->turn off “Test default WordPress search form for spam”->save changes. After changes, you’ll see the search form works OK in mobile version again.

antispam by cleantalk
Advanced settings in Anti-Spam by CleanTalk
wordpress search
Test default WordPress search form for spam
mobile search form
完成變更設定後,可以重新使用 search box

以上方法僅是臨時方案,基於安全連結理由,CleanTalk plugin 還是不建議大家把搜尋框放在站內,以免被 spammers 利用。

The above approach is temporary only, CleanTalk does not recommend putting a search box on the site for preventing spammers and spambots.