Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
287 views
in Q2A Core by
retagged by

I realized that when users enter text and search on my website the search result heading is displayed with a "+" in between the spaces.

For example if someone searches for "What is Facebook opengraph"

The result will come as: "What+is+facebook+opengraph". Searching for "Open graph" will return as "Open+graph".

If someone searches for a single word with space at the end, the space is returned as a "+". For example searching for "bookshop" returns "bookshop" in heading whereas searching for "bookshop " (notice the space after word) returns as "bookshop+".

How do I remove the "+" that replaces the spaces between words?

Q2A version: 1.8.8

2 Answers

+1 vote
by
selected by
 
Best answer

I've had this tab open for a week but I haven't had the change to reply to it. I haven't noticed this issue until now (in fact, I actually understood the question in one of the other comments). This is clearly a bug.

Check this PR: https://github.com/q2a/question2answer/pull/992/files

Apply those changes and let me know if the problem is gone. The explanation of the problem/fix is in the Comments tab.

by
Okay did what you said and found the culprit:

1. No
2. No
3. Yes (the culprit)
4. Yes (not the issue)

So I disabled and (re)enabled plugins one-by-one  as you said...
...and it happens that "q2a Ultimate SEO" plugin was the issue.

I have made required changes to it and now the issue is gone.

NOTE: I think it is coincidence that I noticed this immediately after making the changes earlier that's why I tied the issue to those changes.

Thanks man, now problem solved.

1) Search title is displaying correctly as "Search results for query" without the "+" in between.
2) URL to user pages are structured well.
3) The "Search results for username on website" is now displaying well as just "username on website" as intended.

________
**I've also selected this answer so that it helps anyone with same issue in future.
by
Oh, I see. The Ultimate SEO allows page titles to be changed. If what you are seeing is a bug, and you happen to be using my fork of the project ( which is here: https://github.com/pupi1985/q2a-ultimate-seo ), just let me know and I'll take a look at it
by
Don't know if it's a bug but I know how it happens.

On the q2a Ultimate SEO plugin customisation settings there's the section for "Page Title Customizations" (actually the first customization option)

The last entry on that section is for "User's profile page" and there are three variables to use:
The section reads like this:

•Title for "User's Profile Page":
• available title variables for this page: %site-title%, %user-x%, %current-user%

If you use the option %user-x% it displays as "Search results for user"

I've set my option for the variables as "%user-x% on %site-title%" so the page title is displayed as "Search results for username on website"

I don't know if this is the intention of the plugin or not?

Note: if you use the variable %current-user% the page title displays correctly without the "Search results for...." part.


2) And yes it works that way for both Tohwids (original) version and your (forked) version of the plugin.
by
I see. I have just fixed the issue in my fork. Feel free to update it from here: https://github.com/pupi1985/q2a-ultimate-seo/releases/latest
0 votes
by
I think it needs the "+" sign to represent the URL for the search results. It doesn't work with a space.
by
It doesn't appear in the URL, instead it appears on the heading which starts with "Search results for...."

The URL structure usually replaces spaces between terms with hyphens (-) or for my website it uses %2B.

But the results have a "+" for spaces instead.
by
If you search on this website for a query like "What is q2a" it will display results and the heading at the top will read:

Search results for What is q2a

The URL string will be https://.../search?q=what-is-q2a
__ _ __ _ __ _ __ _

But for my website, the heading reads:

Search results for What+is+q2a (notice the difference?)

Whereas the URL is https://.../search?q=what%2Bis%2Bq2a

__ _ ___ _ __ _ ___

I want to remove the + in the returned heading.
...