Deleting all anchor elements from content

You could use replaceRE for this. You’ll wanna tweak this to your needs (and make the match more specific) but something like this would work.

{{ $content := replaceRE "<a .*\">" "" .Content }}
{{ $content = replaceRE "</a>" "" $content }}
{{ $content | safeHTML }}
2 Likes