> For the complete documentation index, see [llms.txt](https://framework.deep-web-solutions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://framework.deep-web-solutions.com/utilities-module/shortcodes-service.md).

# Shortcodes Service

The shortcodes service is actually extremely similar [to the hooks service](/utilities-module/hooks-service.md) described previously. It's a [single-handler service](/foundations-module/utilities/handlers-and-services.md) with [a runnable and a resettable action](/foundations-module/actions.md). It provides the following public methods:

* `add_shortcode` - registers a shortcode with the handler
* `remove_shortcode` - removes a shortcode registered with the handler
* `remove_all_shortcodes` - removes all shortcodes registered with the handler

It accepts any handler implementing the [`ShortcodesHandlerInterface`](https://github.com/deep-web-solutions/wordpress-framework-utilities/blob/master/src/includes/Shortcodes/ShortcodesHandlerInterface.php) and, just like the hooks service, comes with a default handler that first stores all registered shortcodes in an array and registers them with WP on the `run` action.

The similarities don't end there though! All the traits and interfaces mentioned for the hooks service are also available for the shortcodes service:

* [`ShortcodesServiceAwareInterface`](https://github.com/deep-web-solutions/wordpress-framework-utilities/blob/master/src/includes/Shortcodes/ShortcodesServiceAwareInterface.php) and [`ShortcodesServiceAwareTrait`](https://github.com/deep-web-solutions/wordpress-framework-utilities/blob/master/src/includes/Shortcodes/ShortcodesServiceAwareTrait.php) for a getter/setter pair
* [`ShortcodesServiceRegisterInterface`](https://github.com/deep-web-solutions/wordpress-framework-utilities/blob/master/src/includes/Shortcodes/ShortcodesServiceRegisterInterface.php) and [`ShortcodesServiceRegisterTrait`](https://github.com/deep-web-solutions/wordpress-framework-utilities/blob/master/src/includes/Shortcodes/ShortcodesServiceRegisterTrait.php) for injecting the service externally
* [`InitializeShortcodesTrait`](https://github.com/deep-web-solutions/wordpress-framework-utilities/blob/master/src/includes/Actions/Initializable/InitializeShortcodesServiceTrait.php) for automagically setting the instance on the objec
* [`SetupShortcodesTrait`](https://github.com/deep-web-solutions/wordpress-framework-utilities/blob/master/src/includes/Actions/Setupable/SetupShortcodesTrait.php) for automagically calling the `register_shortcodes` method on setup
