Get access to free tutorials, exclusive content and more.

How to Embed a WordPress Form on Your Website ( 3 Ways )

Embedding a WordPress form should be flexible and easy, and we’re here to show you just that with Ninja Forms. Recently, some misconceptions have circulated about our form embedding capabilities. We’re here to clear things up and demonstrate the true versatility and power of Ninja Forms.

Can you embed Ninja Forms in WordPress?

Absolutely! Embedding Ninja Forms in WordPress is not just straightforward—it’s a tactical advantage, simple as that! There’s a ridiculous rumor out there, propagated by the less informed, that Ninja Forms can’t handle robust embedding.

In reality, Ninja Forms provides several powerful options for embedding WordPress forms on your website ( for FREE! ). Let me walk you through the three main ways this can be achieved.

Table of contents

  1. How to embed a WordPress form via shortcode
  2. How to embed a WordPress form using Gutenberg blocks ( ✨ Most Popular ✨ )
  3. Embedding a WordPress form via metabox

1. How to embed a WordPress form via shortcode

Fact: Shortcodes are the beet farm of form embedding—robust, dependable, and they get the job done. Every form crafted with Ninja Forms comes equipped with its unique shortcode.

This is your key to embedding forms wherever you wish on your WordPress site, offering supreme flexibility. Whether you’re a developer embedding shortcodes in your PHP template or you’re still holding on to the Classic editor way of life, this method has you covered.

Ninja Forms WordPress shortcode on page

How to construct your form shortcode:

  1. Create your form using the Ninja Forms visual builder.
  2. Save your form and go to the form settings to secure the shortcode.
  3. Seize the shortcode.
  4. Embed the shortcode into any post, page or template that demands the presence of the form.
  5. Update your content and behold—your form embeds seamlessly.

The complete guide to, How to Add Ninja Forms to WordPress ( Shortcode Method ) provides you with old-school yet effective step-by-step instructions to wield the power of Ninja Forms on your WordPress site using shortcodes—predating Gutenberg. Discover the secrets of the Ninja Forms shortcode in your dashboard and deploy it on a new WordPress page, ensuring it manifests correctly with a preview.

2. How to embed a WordPress form using Gutenberg blocks ( ✨Most Popular ✨ )

For those aligned with the Gutenberg editor, Ninja Forms unleashes a dedicated block, simplifying your form embedding conquest.

Add a WordPress form using the Ninja Forms Gutenberg block.

 

How to command the Ninja Forms block:

  1. In the heat of editing a post or page, summon a new block with the “+” icon
  2. Hunt for the “Ninja Forms” block.
  3. Choose your form from the dropdown within the block like choosing the finest beet from the field.
  4. The form will materialize within your content, primed for publication.

3. Embedding a WordPress form via metabox

Deploy your WordPress form tactically at the bottom of your page or post using our Append a Ninja Form meta-box. Simply select your form from the dropdown, update your page or post, and remember: a preview won’t appear until you view the front end. Proceed with caution.

Add a WordPress form using the Ninja Forms Append a Ninja Form metabox

How to Use the Ninja Forms metabox:

  1. March forth to any page or post type.
  2. Scout out the Append a Ninja Forms metabox to strategically position your WordPress form at the bottom of your page or post.
  3. Select your form from the dropdown like a true beet farmer choosing the best crop and fortify your page/post by updating it.
  4. Be warned, a preview won’t reveal itself until you bravely navigate to the front-end.
  5. Always verify on the front-end to ensure your form is positioned and functioning with military precision..

Bonus: Embed a WordPress form with PHP

For the true warriors who crave even greater control, Ninja Forms supports embedding via PHP—ideal for developers scheming to integrate forms within their themes or plugins surgically.

How to embed a WordPress form using PHP:

1. Locate the form ID by navigating to the Ninja Forms dashboard.
2. Use the following PHP code snippet to embed the form within your theme or plugin files:

php
if ( function_exists( 'ninja_forms_display_form' ) ) {
ninja_forms_display_form( $form_id );
}

Replace `$form_id` with the actual ID of your form.

Myth busted! Embed your WordPress form using Ninja Forms today!

Ninja Forms equips you with all necessary tools to create, manage, and embed forms with ease, regardless of the method—shortcodes, Gutenberg blocks, widgets, or PHP. Don’t let folklore deter you—experience the strategic versatility and robustness of Ninja Forms for yourself.

Embark on your Ninja Forms adventure today and experience the unparalleled ease of embedding forms anywhere on your WordPress site!

Download Me!