# Embed a form in WordPress

Put a Formstep form inside a WordPress page or post with a Custom HTML block. What WordPress.com plans allow, and why WordPress may remove the code when you save.

You need a WordPress user who may post unfiltered HTML. On a single site you host yourself, that is an Administrator or an Editor. On WordPress.com, you need a paid plan with hosting features activated. See [If WordPress removes the code](#code-removed).

## 1. Copy the embed code

In Formstep, open the **Public link** sheet, click the **Embed** card, then **Copy embed code**.

## 2. Add a Custom HTML block

1. Open the page or post in the block editor.

2. Click the **Block Inserter** and search for HTML, or type `/html` in a new paragraph and press Enter.

3. Click **Edit HTML**, paste the code, and click **Update**. The preview beside the code shows the form. Before WordPress 7.0 the block is one text box: paste the code straight into it.

4. Save or publish the page.

WordPress describes the block on its [Custom HTML block page](https://wordpress.org/documentation/article/custom-html/) and [WordPress.com’s page](https://wordpress.com/support/wordpress-editor/blocks/custom-html-block/).

## Open the form as a popup

Click the **Popup** card in the Public link sheet and copy the popup code. Paste it into a Custom HTML block on the page. With the trigger **Automatically on page load**, nothing more is needed. To open it from a button, add the button to the same block, with the function name from the comment in your code:

```
<button onclick="window.openFormstepPopup_Abc12XYz()">Open the form</button>
```

## If WordPress removes the code

WordPress removes the embed and popup code in two cases:

- Your role may not post unfiltered HTML, as with a Contributor. WordPress strips the code when such a user saves. Ask an Administrator to add the block.

- On WordPress.com, the plan has no hosting features activated. A paid plan alone is not enough; WordPress.com’s help page says installing one plugin activates them. Then paste the code again.

> **If the form does not grow**
>
> If the form shows but does not grow with its content, turn **Auto-resize height** off in Formstep and set a height that fits your form.

## Next steps

[Embedding & popups](https://formstep.io/docs/sharing-publishing/embedding-popups/) — Every embed and popup setting

[Appearance & theming](https://formstep.io/docs/branding-domains/appearance-theming/) — Make the form look like your site
