Insert “Back to Blog” text link at the top of blog posts script for Squarespace

Navigating a blog should be seamless for readers. Adding a “Back to Blog” link at the top of your blog posts is a simple way to enhance user experience by giving readers a quick way to return to your main blog page and stay on your website for longer.

1. Go to the Blog Page Settings

  1. In the Home Menu, select Pages, then find and click on your Blog page. This page should list all your blog posts.
    (If the URL for your blog is not “/blog”, you will need to update that accordingly in the code below)

2. Add Code to Blog Post Header

  1. Open the settings by clicking the ⚙️ button.

  2. In the blog settings, click on the Post Blog Item Code Injection section.

  3. Insert the following code snippet to create the “Back to Blog” link.

  4. Click Save to apply changes.

Code Injection:

<script>
  $(document).ready(function() { 
		$('<a href="/blog" class="eventitem-backlink">← Back to Blog</a>').insertBefore('.blog-item-title');
	});
</script>

<style>
  a.eventitem-backlink {
    margin: 0;
}
</style>
 

Found this tutorial helpful?
Previous
Previous

How to add a sidebar to Squarespace blog with CSS (without a plugin)

Next
Next

Full width newsletter block button on mobile in Squarespace