A simple and customizable link container block for the WordPress block editor (Gutenberg). This block acts as a wrapper for other blocks while providing a customizable href and onClick attribute.
- 🏗 Gutenberg-native – Easily insert a container that acts as a clickable link.
- 🔗 Inner Blocks Support – Nest any other blocks inside the link container.
- ✏ Customizable Href & OnClick – Set a URL and JavaScript click behavior via block settings.
- 🔄 New Tab Option – Open links in a new tab with a simple toggle.
- 📱 Responsive & Theme-Compatible – Works across all devices and integrates seamlessly with any theme.
- 🎨 No Code Required – Adjust attributes via the block settings panel.
This plugin is perfect for clickable sections, call-to-action blocks, interactive containers, and more.
- Clone the repository or download the latest release.
- Upload the plugin files to
/wp-content/plugins/link-container-block, or install via the Plugins screen in WordPress.
You can install the plugin using Composer:
composer config repositories.link-container-block vcs https://github.com/moveyourdigital/wp-link-container-block.git
composer require moveyourdigital/wp-link-container-block- Activate the plugin via WordPress Admin > Plugins.
- In the Gutenberg editor, search for Link Container Block, insert it, and start adding content.
- Customize via the block settings panel.
Simply insert the Link Container Block from the Gutenberg editor, set the href attribute in the block settings, and add content inside the block.
Yes! This block supports InnerBlocks, so you can place any other blocks inside it.
No. If an href is set, the block will render as an <a>. If no href is provided, it will render as a <div> to avoid invalid HTML.
Yes! The block allows setting an onClick attribute where you can enter JavaScript code to execute when the block is clicked.
Yes, there's a toggle in the block settings that allows you to open the link in a new tab (target="_blank").
Yes, the block is designed to work with any Gutenberg-compatible theme. However, you may need to adjust styles for better integration.
- Generates button when href is not provided
- Initial release 🎉
- Added support for wrapping inner blocks inside a clickable container.
- Integrated customizable href and onclick attributes.
- Included a toggle for opening links in a new tab.
This plugin was scaffolded using the WordPress Create Block tool.
- Fork this repository.
- Create a new feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -m "Added new feature"). - Push to the branch (
git push origin feature-name). - Open a Pull Request.
For issues or feature requests:
- 📌 Open an issue on GitHub Issues.
- 📩 Reach out via the WordPress support forum.
This plugin is licensed under GPL-2.0-or-later. See the LICENSE file for details.