Eliminate Last Name Field From Newsletter Block in Squarespace
Eliminate Last Name Field From Newsletter Block in Squarespace
Squarespace’s newsletter block does not provide an option for requesting the first name only of a subscriber.
When toggling on the ‘Require Name Field,’ both the first and last name of the subscriber are required.
This may cause some subscribers to refrain from subscribing. Other Email Service Providers like ConvertKit have an option for requesting the first name only of the subscriber, making visitors more like to subscribe.
First and Last Name Required
First Name Only
In this tutorial, I’m going to show you how to eliminate the last name field from the Squarespace newsletter block using a bit of code injected in the footer of your Squarespace website.
And before you go, be sure to check out my other website strategy blog posts for more tips on attracting and engaging your target audience to your Squarespace website.
How to Eliminate the Last Name Field From the Newsletter Form Block in Squarespace
Head on over to ‘Pages’
Scroll all the way down to ‘Website Tools’
Select ‘Code Injection’
In the footer, copy and paste the code below (scroll down)
Select save
So easy, right?
Here’s the Code
<!-- Eliminate Last Name Field From Newsletter Block -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
const lnames = document.querySelectorAll('.last-name input')
const lnameFields = document.querySelectorAll('.last-name')
$(document).ready(function(){
lnames.forEach(lname => {
lname.value = "-"
})
lnameFields.forEach(lnameField => {
lnameField.style.display = "none"
})
});
</script>
<style>
.newsletter-form-field-wrapper.field.last-name {
display: none;
}
</style>
Was this helpful?
Are you using Squarespace campaigns? Have you considered switching to a more robust and functional Email Service Provider like ConvertKit? Share your thoughts 👇
This page contains affiliate links
My Insta
@jenxwebdesign
Like this post?