How to Add Close Button in Alert Box/Message Box in WordPress?

Key Takeaways

  • Nexter Blocks includes a Message Box block that allows users to add a close button to alert boxes in WordPress.
  • Users can enable the Close Icon toggle in the Message Box block to display a close button.
  • The process involves adding a title, description, and selecting an icon for the close button in the Message Box block.
Table of Contents

Do you want to add a close button to the WordPress alert box? Adding a close button to the alert box can improve the user experience by giving an option to the users to close the message.

With the Message Box block from Nexter Blocks, you can add a close button to alert boxes or message boxes in WordPress.

To check the complete feature overview documentation of the Nexter Blocks Message Box block, click here.

Requirement  – This block is a part of the Nexter Blocks, make sure it’s installed & activated to enjoy all its powers.

To do this, add the Message Box block and follow the steps.

1. Add the title and description from the Title and Description sections.

2. Then enable the Close Icon toggle.

3. After that, add the icon from the Select Close Icon section.

Now you’ll see a close button in the alert box, which you can click to close it.

About the Author

Photo of Aditya Sharma CMO of NexterWP
CMO at POSIMYTH Innovations · NexterWP · 7 years experience

He has spent years in the WordPress ecosystem building, breaking, and optimizing sites until they actually perform. He works at the intersection of speed, growth, and usability, helping creators ship websites that load fast and convert. An active WordPress community contributor sharing through tools, tutorials, and direct collaboration. Tested practice, not theory.

WordpressThemesElementorn8nAIClaudeAutomationServer

Share your Thoughts

Get Instant Answers to all your questions about Nexter Blocks,
Extensions & Theme trained on 1000+ Docs and Videos

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!

Related Frequently Asked Questions

What if the close button doesn't appear in the alert box?

If the close button isn't showing up, ensure that you have enabled the Close Icon toggle in the Message Box block settings. This toggle is essential for displaying the close button. Without it activated, users won't have the option to close the alert box, which can lead to a frustrating experience.

Can I use the Message Box block for notifications other than alerts?

The Message Box block from Nexter Blocks is versatile and can be used for various types of notifications, not just alerts. You can customize the title and description to fit different contexts, making it suitable for announcements, reminders, or any important messages you want to convey to users.

What are the best practices for using the close button in message boxes?

When using a close button in message boxes, ensure that the message is clear and concise. This helps users understand the importance of the message before they dismiss it. Additionally, consider the timing of when to display the message; avoid interrupting user actions unnecessarily, as this can lead to a negative experience.

Does the Message Box block work with other page builders?

The Message Box block is designed specifically for Gutenberg, which is the primary builder for NexterWP. While it supports Elementor and Bricks, the close button feature is optimized for use within the Gutenberg environment. If you're using other builders, you may not have access to the same functionality.

What happens if I forget to add a title or description to the Message Box?

If you skip adding a title or description to the Message Box, the alert box may appear empty or lack context, which can confuse users. It's important to provide clear information so that users understand the purpose of the message. This enhances user experience and ensures effective communication.

Are there any limitations to using the Message Box block?

One limitation of the Message Box block is that it requires the Nexter Blocks plugin to be installed and activated. Without this, you won't be able to access the block or its features, including the close button. Ensure that you have the plugin set up to take full advantage of its capabilities.

Last reviewed: April 14, 2026

Related Docs