Site logo

Archived topic

link to search results page from linkedin

3 replies · Started by Leslie on February 13, 2022

Viewing posts 1–4 of 4

Hi, I am creating a linkedin post to show off my site's search results. I am adding the following link to the linkedin post:

https://lexata.ca/?s=do+ghg+emissions+risks+have+to+be+reported%3F.

If you insert that url into google, you'll see my page. Near the top is the nice heading: "search results for: do ghg emissions risks have to be reported?"

But when I insert the same url into a linkedin post, and then click on it from there, the heading "search results for..." turns empty. (The actual search results remain fine, it's just the user isn't seeing the query). I think the problem arises because linkedin seems to be automatically changing the url, by replacing this:

/?=

with this:

/search/

Very annoying!

Do you have any suggestions for styling or php that I could add to force the url not to be changed?

Thanks very much.

Hi Leslie,

I tested the same url on different social platforms and it seems to be working fine on LinkedIn as well.

Since the issue is isolated to Linkedin, if in case it is actually having issues on your end, it may be best to ask them for their preferred way for sharing URLs as this is beyond what the theme controls.

Or if you don't mind a workaround, I suggest using URL shorteners like bitly or tinyurl so Linkedin doesn't have a /?= to change to /search/.

I added this to my child functions.php:

// Remove - Canonical for - [Search - Page]
function remove_canonical() {
if ( is_search() ) {
add_filter( 'rank_math/frontend/canonical', '__return_false', 10, 1 );
}
}
add_action('wp', 'remove_canonical');

This archived topic is closed to new replies.