If you want to add shortcodes in Divi Theme, there are multiple ways to do it depending on the type of shortcode, plugin compatibility, and where you want the content to appear.
As a WordPress theme designer working with Divi websites for over a decade, I regularly use shortcodes to embed contact forms, WooCommerce products, dynamic content, tabs, sliders, calculators, reusable layouts, and custom functionality inside Divi Builder.
The good news is that Divi fully supports WordPress shortcodes through its Text Module, Code Module, Theme Builder templates, and even reusable Divi Library layouts.

In this complete guide, you’ll learn:
- How to add shortcodes in Divi Builder
- When to use Text Module vs Code Module
- How to use Divi Library shortcodes
- Common shortcode problems and fixes
- Best shortcode plugins for Divi
- WooCommerce and Contact Form shortcode examples
- Divi 5 shortcode compatibility tips
Let’s get started.
Disclosure: We get a commission when you buy a product via our affiliate link at no additional cost.
Table Of Contents
What Are WordPress Shortcodes?
A shortcode is a small piece of code used in WordPress to display dynamic content without writing full PHP or HTML manually.
Shortcodes are commonly generated by plugins! When added inside a supported area, WordPress automatically converts the shortcode into functional content.
Example shortcode: [contact-form-7 id=”123″] to add a Form. Likewise, you can add Product grids, Sliders, Pricing Tables, etc.
Since Divi Builder supports shortcode rendering, you can easily embed these elements almost anywhere on your website.
Method 1 – Add Shortcode Using Divi Text Module
Step 1: Go to your WordPress Dashboard > Pages > Add New (you may also add shortcodes to existing pages).
Step 2: Name the page you have created. Click “Use Divi builder”.

Step 3: Now, you will get three preferences, and I choose “Build from Scratch” option.

Step 4: I pick one-column style. Check the following image!

Step 5: Now, search for the text module. In that module, paste the shortcode under the “Text” tab.

Note – You should not paste the code under the “Visual” section. Add it under the “text” tab in the text module of the Divi theme, as shown in the image below.

Step 6: Click the “Green Tick” button at the bottom of the Divi settings to publish the function of the shortcode. You can see the live result on the right side.
This method is well suitable for Contact forms, Dynamic content and Woocommerce products. I always prefer this method because of better visual compatiblity and clean frontend rendering.
Method 2 – Add Shortcodes Through Divi Code Module
After choosing the one-column structure in the Divi theme, search for the code module instead of the text module.

In this module, paste the shortcode like this. That’s it! Publish the page and check the output.

I recommend this Code Module method for advanced HTML/script integration.
How to Use Divi Library Shortcodes?
One of the most powerful Divi features is reusable layouts. You can save Sections, Rows, Modules, and Entire page layouts inside the Divi Library and reuse them using shortcodes.
This is incredibly useful for:
- CTA sections
- Lead forms
- Reusable pricing tables
- Announcement banners
- Affiliate blocks
- Dynamic WooCommerce sections
How Divi Library Shortcodes Work?
After saving a layout to Divi Library, plugins like “Divi Library Shortcodes” allow you to generate reusable shortcodes.
Example: [divi_shortcode id=”452″]
You can place that shortcode Inside posts, Widgets, Theme Builder templates, Footer areas and Third-party page builders. This creates reusable design systems and speeds up workflow dramatically.
Adding WooCommerce Shortcodes in Divi
Divi works extremely well with WooCommerce shortcodes.
Popular examples include:
- Product Grid – [products limit=”8″ columns=”4″]
- Featured Products – [featured_products limit=”4″]
- Sale Products – [sale_products limit=”6″]
- Product Categories – [product_categories number=”6″]
These shortcodes can be added inside the Product pages, Homepage layouts, Landing pages, Sidebar sections, and Theme Builder templates. For eCommerce websites, this flexibility is incredibly useful.
Common Divi Shortcode Problems and Fixes
If your shortcode is not working in Divi, these fixes usually solve the problem.
Problem 1 – Shortcode Displays as Plain Text
Cause – Plugin conflict or incorrect module.
How To Fix?
- Use:Text Module instead of Code Module
- Backend editor instead of Visual Builder
Problem 2 – Shortcode Output Is Blank
Cause – Caching or plugin issue.
How To Fix?
- Clear cache
- Disable optimization plugins temporarily
- Regenerate CSS in Divi settings
Problem 3 – Styling Looks Broken
Cause – Theme CSS conflict.
How To Fix?
Add custom CSS:
- spacing
- width
- mobile responsiveness
- button styling
Problem 4 – WooCommerce Shortcodes Not Showing
Cause – WooCommerce pages not configured correctly.
How To Fix?
- Update WooCommerce templates
- Re-save permalinks
- Regenerate product lookup tables
Problem 5 – Divi Visual Builder Freezes
Cause – Heavy shortcode scripts.
How To Fix?
- Disable unused plugins
- Test in Safe Mode
- Switch rendering to backend editor
Video Tutorial To Include Shortcodes In Divi
If you find it difficult to follow the step-by-step procedure to paste the shortcodes in the Divi theme, watch the video tutorial to finish the task.
Frequently Asked Questions
Does Divi support WordPress shortcodes?
Yes, Shortcode works with Divi! Check the above video tutorial to understand the simple process.
Can I use WooCommerce shortcodes in Divi?
Absolutely. WooCommerce shortcodes work extremely well with Divi Builder and Theme Builder templates.
Are shortcodes supported in Divi 5?
Yes. Divi 5 still supports WordPress shortcodes and maintains backward compatibility with most plugins.
How to create a WordPress shortcode in the Divi theme library?
Many plugins are available to get the job done. Shortcodes for Divi is one of the best free plugins to display the library template in the form of a shortcode.
Wrapping Up
I use several page builder plugins to design my clients’ sites; Divi is one among them. It is an excellent tool that boasts many impressive features for customizing the website for branding. Glad I’m getting pleasant opportunities to write the Divi tutorials like this for my site readers.
Shortcode helps us add specialized content to our WordPress site for high user engagement. Using the Divi builder is just a piece of cake for incorporating shortcodes wherever you want. I hope you have learned how to add shortcodes in the Divi theme. Catch me if you need any design help.


