Sunday, July 27, 2025

How to Link to a Specific Place on a Page

What if you want to have a clickable thingy (button or link or menu item) that goes to a specific place on a web page instead of positioning it at the top? Here are the simple steps:

  1. Place the cursor at the point where you want the link to position the page; best on the left edge of the first line of a text thingy or on a blank line above an image or table or shortcode
  2. Drop an anchor (Classic Editor: Insert→Anchor;  Block Editor see below) and give it an Id (short label, no spaces, dashes instead); the anchor will be invisible when the page is displayed; let's say you chose the Id  my-id 
  3. Create a button or link or menu item:
    1. If the thingy us on the same page, the URL would simple be  #my-id 
    2. Otherwise, it would be the usual URL for the page with #hotnews appended, e.g. https://example.com/pagename#hotnews 
    3. Note: the # prepended to the Id tells the browser, "on the page, go here"
Same Page Use Case
You have a long page. All that scrolling makes it hard to find stuff. You create a row of links at the top of the page that jump to the various parts of the page (you might separate them with a vertical bar | with a space on either side). A sort of clickable table of contents.

Here's an example:


Drop an Anchor with the Block Editor
  1. Select the Block: Choose the block you want to link to (e.g., a heading, paragraph, image)
  2. Access Block Settings: In the right-hand sidebar, click on the "Settings" tab (gear icon)
  3. Locate "Advanced" Section: Expand the "Advanced" section within the block settings
  4. Enter HTML Anchor: In the "HTML Anchor" field, type a unique, descriptive name for your anchor (e.g., section-titleimage-gallery). This name should be unique on the page and typically uses hyphens instead of spaces.