How to Embed a WordPress Form on Your Website ( 3 Ways ) - Ninja Forms
Get access to free tutorials, exclusive content and more.

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

Ninja Forms offers the flexibility to embed a WordPress form easily. Come with us as we demonstrate Ninja Forms’ versatility and power in this arena.

Can You Embed Ninja Forms in WordPress?

Absolutely! Embedding Ninja Forms in WordPress is straightforward and will give your website an edge. We provide several powerful, free options for embedding WordPress forms on a website. Let’s discuss the three main ways you can achieve this.

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 robust and dependable, and they get the job done. Every form crafted with Ninja Forms comes equipped with its unique shortcode.

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

Ninja Forms WordPress shortcode on page

How to Construct a Form Shortcode

  1. Create a form using the Ninja Forms visual builder.
  2. Save the 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.
  5. Update your content and behold — the form embeds seamlessly.

Learn How to Add Ninja Forms to WordPress (Shortcode Method) with effective step-by-step instructions, and wield the power of Ninja Forms on any 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 using the Gutenberg editor, Ninja Forms unleashes a dedicated block, simplifying form embedding.

Add a WordPress form using the Ninja Forms Gutenberg block.

 

How to Command the Ninja Forms Block

  1. When editing a post or page, summon a new block with the “+” icon.
  2. Search for the “Ninja Forms” block.
  3. Choose a form from the drop-down within the block.
  4. The form will materialize within your content and be primed for publication.

3. Embedding a WordPress Form via Metabox

Use our Append a Ninja Form meta-box to place a WordPress form at the bottom of your page or post. Select the form from the drop-down menu, update the page or post, and remember: a preview won’t appear until you view the front end.

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

How to Use the Ninja Forms Metabox

You can embed a form using Metabox on any page or post type. Here’s how:

  1. Use the Append a Ninja Forms metabox to strategically position a WordPress form at the bottom of any page or post.
  2. Select the form from the drop-down and then update it to fortify your page/post.
  3. A preview will only appear once you navigate to the front-end.
  4. Always verify on the front-end to ensure the form is positioned and functioning optimally.

Bonus: Embed a WordPress Form With PHP

Ninja Forms also supports embedding forms via PHP. This approach is ideal for developers who want to integrate forms surgically within their themes or plugins.

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 form ID.

Why Choose Ninja Forms to Embed a Form in WordPress?

There are many advantages to using Ninja Forms for form embedment, including:

  • Versatility: When you choose Ninja Forms, you can choose the simplest form embedding option (shortcode) or opt for something more complex (PHP). Our software does it all.
  • Ease of use: You don’t need to know how to embed a form in WordPress when you work with Ninja Forms. Our step-by-step tutorials and diverse options make it easy.
  • Scalability: We offer something for every client. From the free plan for small businesses and individuals to more complex plans for those needing comprehensive functionality.

Embed Your WordPress Form Using Ninja Forms Today!

Ninja Forms equips you with all the tools to create, manage, and embed forms easily, regardless of the method — shortcodes, Gutenberg blocks, widgets, or PHP. Whether you want to know how to embed a contact form in WordPress or need the full range of form versatility, we have an option for you. ​

Don’t let folklore deter you — experience the strategic versatility and robustness of Ninja Forms. Download the Ninja Forms plugin today and experience the unparalleled ease of embedding forms anywhere on your WordPress site!