最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Search results: How to add direct jump to anchor?

programmeradmin1浏览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:

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

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:

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

Share Improve this question edited Feb 25, 2021 at 11:12 Pavel Janicek asked Feb 25, 2021 at 9:50 Pavel JanicekPavel Janicek 2123 silver badges14 bronze badges
Add a comment  | 

1 Answer 1

Reset to default -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

发布评论

评论列表(0)

  1. 暂无评论