<!--emailsub--> shortcode outputs code

I added the email sub shortcode to a page and instead of the form, it outputs:

<form method="post" id="emailsub" action="/api/collections/justinferriman/email/subscribe"><input type="hidden" name="slug" value="about" /><input type="hidden" name="web" value="1" /><div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="email" name="flo18N1jCvpErRsQUJdQMXojhCnztVLYOJpdlLE" tabindex="-1" value="" /><input type="password" name="fake_password" tabindex="-1" placeholder="password" autocomplete="new-password" /></div><input type="email" name="email" placeholder="me@example.com" /><input type="submit" id="subscribe-btn" value="Subscribe" /></form>

Yep, that looks correct! Is the form not showing up correctly on the page?

Hi Matt,

The code shows on the page (the code that I pasted), instead of the form when I add the shortcode to the page.

Ah okay, that’s not right. Can you send the page where you’re seeing that (either publicly or via private message)?

1 Like


Thanks! This is a quick fix – it looks like you have three backticks (```) around the shortcode. So you’ll just include the <!--emailsub--> shortcode without those backticks around it, and you’ll see the form itself on the page.

Thanks Matt,

Though, I am not manually adding the backticks (I just select the “code” text type and then type it out). I just tried it again and got the same result – somehow the backticks are getting added after publishing, I suppose.

Ah, so this is in the Classic editor. Selecting the “code” type is what’s inserting the backticks for you, then. Instead, you’ll want to highlight the shortcode text and change it back to plain text, then publish it.

One important bug to note with the Classic editor right now: it doesn’t handle shortcodes besides “Read more” very well. So when you go back to edit your post, you’ll actually see your <!--emailsub--> shortcode turn into a “Read more” link. If you then publish your edited post, it will actually transform into a “Read more” link.

I hope to get this fixed very soon – I just haven’t been able to dig into it yet. But for now, I’d suggest making this edit last, once you’ve finished your page – or switching to the Plain Editor when working on this page.

1 Like

That did the trick, thanks!

1 Like