Splitting Content »Page Jumps
Classic Editor / HTML Page Jumps
The following instructions are for the Classic Editor, or if you want to manually create page jumps using HTML code. Click here if you’re using the WordPress/Block Editor.
The two parts of a page jump are the target text and the link.
When the link is clicked, it will bring your visitors to the place in the page where the target text exists.
The following code would be added in the HTML version of your editor.
Click here for the Classic Editor HTML option.
Click here for the WordPress/Blocks Editor HTML option.
The target text is written like this:
<p id="unique-identifier">I am the target text.</p>
Make sure you have no spaces in your IDs, since that can cause problems in older browsers. Also, be sure to use a different ID for each target that you create.
One way to link to your target is to select some text, and then use the insert/edit link button. In the URL field there, enter the
# symbol, followed by the name of the target’s ID like this:
Notice how the
#unique-identifier in the ‘Click me!’ link matches the ID of the target text from earlier.
If you wanted to write this link yourself in HTML code, it would look like this:
<a href="https://wordpress.com/support/splitting-content/page-jumps/2/#unique-identifier">Click me!</a>
You can repeat this process to create additional page jumps. Just be sure to use a different ID for each target/link pair. IDs can be anything you want, such as
Sending Readers to the Top of the Page
At the beginning of the post or page, use the Text editor to add this above all of the other HTML:
<div id="top"> </div>
This creates an invisible target at the top of your post or page which has
top as its ID. It can be helpful to have an invisible target if you don’t actually want to add visible text to the location of the target.
Alternatively, instead of putting the ID attribute on an empty
<div> tag to create an invisible target, you can add the ID to the first element on the page – such as a heading – like this:
<h1 id="top">Page Heading</h1>
You can use the insert/edit link button to link existing text to this target by putting
#top in the URL field, or you can write this in the Text editor:
Jumping to a Target on Another Page or Post
Once you have created an target, you can quickly access the URL which links to that target.
Let’s say that you’ve created an target on a page with this URL:
All you have to do is add the
# symbol followed by the target ID to the end of the URL like this:
Now that you have the URL for the target, you can use it to link to that target from any other page or post on your site:
Not quite what you’re looking for?
- Our Story
- Terms of Service
- Matt Mullenweg
- Automattic is hiring backend developers anywhere in the world. Join us!
FROM OUR BLOGS
- All-Time Favorites
- A Treasure Trove of Archives: Our Absolute Favorite Posts
- Join Our Discover Daily Prompts in April!