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
- How to embed a WordPress form via shortcode
- How to embed a WordPress form using Gutenberg blocks ( ✨ Most Popular ✨ )
- 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.
How to construct your form shortcode:
- Create your form using the Ninja Forms visual builder.
- Save your form and go to the form settings to secure the shortcode.
- Seize the shortcode.
- Embed the shortcode into any post, page or template that demands the presence of the form.
- 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.
How to command the Ninja Forms block:
- In the heat of editing a post or page, summon a new block with the “+” icon
- Hunt for the “Ninja Forms” block.
- Choose your form from the dropdown within the block like choosing the finest beet from the field.
- The form will materialize within your content, primed for publication.
3. Embedding a WordPress form via metabox
-
March forth to any page or post type.
- Scout out the Append a Ninja Forms metabox to strategically position your WordPress form at the bottom of your page or post.
- Select your form from the dropdown like a true beet farmer choosing the best crop and fortify your page/post by updating it.
- Be warned, a preview won’t reveal itself until you bravely navigate to the front-end.
- 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!