WordPress keeps messing with my code in Custom HTML block.

  • Unknown's avatar

    Hello,

    I am trying to add code for a sign up form to my site. When I edit the page, add the HTML code, and preview in the editor the form shows up fine. However, as soon as I leave the page or preview the page the code changes and gets all messed up.

    Why is WordPress changing my code?

    See code below:

    <a href="https://f.convertkit.com/ckjs/ck.5.js">https://f.convertkit.com/ckjs/ck.5.js</a>
          <form action="https://app.convertkit.com/forms/2894467/subscriptions" class="seva-form formkit-form"...

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    The code you can use on the wordpress.com platform is very limited, https://wordpress.com/support/code/.

  • Hi there,

    Specifically in this case, <form> HTML tags cannot be used on WordPress.com sites – <form> tags, along with <iframe> and <script> tags can potentially be used to inject malware into a site, and as WordPress.com is a shared multisite environment, one person adding malware on their site in this way can affect the entire network.

    If you want to collect email addresses for your ConvertKit mailing list, you can use our built-in Form Block to collect those emails, and then add them to your mailing list manually:

    https://wordpress.com/en/support/wordpress-editor/blocks/form-block/

    Or else you’ll need to link to your subscription form at ConvertKit from your site, so people can sign up there directly.

    Embedding your form will also be possible on our Business Plan – sites on that plan are created as individual WordPress installations, and don’t carry the same code restrictions as sites on other plans, as bad code on such a site won’t put the entire network at risk.

    Let me know if you have any questions about this.

    P.S., I’m redacting some of your code above, just to make this thread easier to read.

  • The topic ‘WordPress keeps messing with my code in Custom HTML block.’ is closed to new replies.