0

I would like to add "Jump to section" links directly to the WordPress search results.

Example: Say I have long product page with description of several products. Say the page "Products" contains "Flux Capacitor", "Shrink ray" and "Batvision" products.

Now, if someone searches for "Batvision", they (correctly) see link to "Products" page. However, in order to find the Batvision, they have to scroll way down to correct section of such page.

Basically, I am trying to find this solution, but using WordPress search:

enter image description here

Is there a way how to achieve it? And if so, how?

-1

You should have the navigation menu with anchors on your page.

<ol>
 <li><a href="#products">Products</a></li>
 <li><a href="#examples">Example</a></li>
</ol>

And the sections with relevant ID where are these anchors are linked to.

<h2 id="products">Products</h2>

After the changes are done, ask google to reindex your page and wait=)

Here is detailed description: here

2
  • That will help to Google. But I am searching for the same inside WordPress Search results* basically how to achieve that if you add ?s=batman at the end of URL of your site – Pavel Janicek Feb 25 at 11:06
  • by default, WordPress can't do this. Probably the best way is to make fake pages (add needed search keywords into these pages content or excerpt) for each section - so these pages will appear in search. Then using some redirect plugin add a redirect from fake page to section https://homepage.com#products. So the user will find the fake page in search, after clicking he will be redirected to needed section. – Jarlax Feb 25 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.