🎯 Have You Used Conditional Shortcodes in Gravity Forms
I don't think this is a very well-known feature of Gravity Forms, but it is awesome! I ran into a small but important challenge while working on a reporting system for WP Mantis, my WordPress support company. We’re building out a form to generate weekly site reports that get emailed to clients, and I wanted those reports to be more visually clear based on status updates. Here’s what I needed: - ✅ If a client’s site is clean, I wanted the text to appear green. - ❌ If there’s a security issue, the text should show up red. - 🖥️ And if we don’t host the site, the hosting section in the report should be hidden altogether. The solution? Conditional shortcodes — one of Gravity Forms’ lesser-known but incredibly powerful tools. 💡 What Are Conditional Shortcodes? Conditional shortcodes let you control which content shows up in confirmations or notifications based on form field values. You can do things like: - Change styling (color, bold, etc.) depending on selected values - Show or hide entire sections - Create dynamic content that feels personalized and intelligent In my case, I used them to: - Apply conditional styling to the Security Status section (green for clean, red for issues) - Show or hide the Hosting Report section based on whether we host the client’s site 📧 The Result? When the form is submitted: - The notification email shows “Clean” in green ✅ - Or “Issue Found” in red ❌ - And the hosting section only appears if applicable It’s a clean, professional, and clear way to communicate status without cluttering the report. 🧪 If You’ve Never Used Conditional Shortcodes… Now’s the time to try. You won’t need them every day—but when you do, they can make your notifications feel polished and purposeful. 🎥 Watch the video if you want to see it in action. Let me know if you’ve used conditional shortcodes creatively—I’d love to see what others are doing with this feature!