Remove https:// from link text
This code snippet allows you to automatically remove https:// from all link URLs on absolute URL links (links without anchor text) on your Webflow site. This is a great way to cleanup links or pages of links on your Webflow site.
This code snippet allows you to automatically remove https:// from all link URLs on absolute URL links (links without anchor text) on your Webflow site. This is a great way to cleanup links or pages of links on your Webflow site.
How to add it
Give each link element an attribute of data-clean="remove-http" and then use the jQuery code below to remove any http:// or https:// text at the beginning of each link.
The code
Javascript
<script>
$(function () {
$( "a[data-clean='remove-http']" ).each(function() {
var clean = $(this).text().replace(/^\/\/|^.*?:(\/\/)?/, '');
$(this).text(clean);
});
});
</script>