How to create and customize a Klaviyo unsubscribe page

  • 18 July 2022
  • 0 replies

Userlevel 6
Badge +50

Klaviyo provides out of the box subscribe/unsubscribe pages to get you up and running as quickly as possible. While there are tools to help you edit these pages, there are some limits. 

For example if you want to change the structure of the page, or modify certain parts of the text into a different language, you might not be able to.


To allow you to customize everything, Klaviyo has a “Hosted Pages” feature which allows you to host your very own unsubscribe page. Hosted Pages support using HTML, CSS, Javascript and our special Django templating language, giving you the power to build a completely custom page from scratch.


It can be challenging to build a page if you have limited HTML knowledge from scratch, so we are going to provide some copy and paste snippets of code below and show you exactly how to create your own hosted page.


Accessing Hosted Pages

First off, the Hosted Pages feature is only available to paid verified Klaviyo accounts, please see here on how to activate it if you do not have it already.


Once activated, you will see a link to it in your navigation menu.



Create an unsubscribe page

Now that you have access, let’s create a new page and call it “unsubscribe”


You should then see something like this



Now go ahead and delete all of that text, and replace it with the code snippet below.


Click save, and then preview the page. It should look like below



You are now free to modify any of the code on this page. For example, if you wanted to change the unsubscribe button, simply edit the text here at line 143



Adding your logo

You might want to add your logo to the unsubscribe page, to this first we need to upload the logo as an “asset” or if you already have an image hosted you can use this.


Once it’s uploaded as an asset, click on the image and copy the url of it by right clicking and clicking “Copy Image Address”

WhziCyOrKB5QBNziKM25WjFSQpjBQQM91WceM2NWwmLcP78_9mrz3DXNsgEF8e3nS6uV3mwJbsnO9b3BwejWNNUd5C4ceKXYxbfjMc0HONyA0YOko-yetch85LhKTQF8v5GU_aGZ4ynZboFla4I Now you can change this snippet of code on lines 115 - 118 to remove the comment symbols and add in your image URL


Click save and the preview button once more, and you should have something like below



Activating Your Unsubscribe Page

Once you are happy with your unsubscribe page, you will need to activate it by selecting a “custom page” as your unsubscribe page.


You can do this by navigating to “Preference Pages” and then selecting “use custom page”. Select the new unsubscribe page you created from the popup window.



Remember, you can also have different unsubscribe pages on a list level too, so don’t forget to update your list specific unsubscribe page too.


Custom Unsubscribe Confirmation Page

The process for creating an unsubscribe confirmation page is almost identical. 

Create a new page “unsubscribe confirmation” and replace the code with the below snippet


Click, Save and then Preview, you should see something like below



Once you are happy with the confirmation page, there is one last step to complete.


Back in the “unsubscribe” page you made, there is an extra line of code that we need to update. This special line of code tells Klaviyo where to redirect the user after they click “Unsubscribe”


This could be to a certain page on your website, but we want to redirect to the confirmation page you just created.


Preview your confirmation page and copy the URL from your browser



Now back in your unsubscribe page we need to update a line of code with this URL. Replace the text highlighted with the URL you just copied.


Then remove the “<!--” and “-->” symbols to uncomment the code.


You should end up with something like below


Note: Make sure not to remove the ?a={{request.GET.a}} bit from the URL, this is very important!


That’s it! You should now have a template for a custom unsubscribe and unsubscribe confirmation page that you can modify if needed.



It’s always a good idea to test and make sure everything is working properly. You will need to send a real email in order for our unsubscribe links to generate properly, a test send will not work.


Simply create a list or segment with just your email address, make sure you have updated the lists unsubscribe page to use your custom page, and send yourself an email.


When you click the unsubscribe link, it should pre-populate your email address.



Further resources:

Interested in learning more about hosted pages? We have an advanced article on our developer blog for those comfortable building their own pages from scratch.

0 replies

Be the first to reply!