RTFM

Shortcode Galaxy

Shortcode Galaxy
Current Version
1.0.1
Requires WordPress
6.5
Tested Up To
7.0

Overview

Shortcode Galaxy adds a library of utility shortcodes for common WordPress tasks such as outputting site details, dates, post data, user data, URLs, and WooCommerce information.

All shortcodes are disabled by default. A shortcode only becomes available after you enable it in the plugin settings.

Requirements

  • WordPress 6.5 or newer
  • PHP 7.4 or newer
  • WooCommerce is optional and only required for WooCommerce shortcodes

Installation

  1. Upload the shortcode-galaxy plugin folder to /wp-content/plugins/.
  2. Activate Shortcode Galaxy from the WordPress Plugins screen.
  3. Go to Settings > Shortcode Galaxy.
  4. Enable the shortcodes you want to use.
  5. Save your settings if JavaScript is disabled. With JavaScript enabled, toggles save automatically.

Managing Shortcodes

The settings screen is the control center for the plugin.

  • Each shortcode is shown in a card with its name, description, and example output.
  • Use the toggle on a card to enable or disable that shortcode.
  • Use the copy button to copy the base shortcode tag.
  • Open Attributes & Builder to review supported attributes, build a custom shortcode, and preview output.
  • Disabled shortcodes are not registered on the front end.

Editor Support

In the WordPress block editor, the core Shortcode block includes a Shortcode Galaxy toolbar picker.

  • You can browse available shortcodes by category.
  • You can enable or disable shortcodes without leaving the editor.
  • You can build a shortcode with attributes and insert it into the block.
  • You can preview shortcode output before inserting it.

In Elementor, the Shortcode widget includes a Browse Shortcodes button in the widget sidebar.

  • You can open Shortcode Galaxy without leaving the Elementor widget controls.
  • You can enable or disable shortcodes from the same modal used in the block editor.
  • You can build a shortcode with attributes and insert it directly into the widget’s shortcode field.
  • You can preview shortcode output before inserting it.
  • The Elementor modal is styled for readable light and dark editor themes.
  • The Elementor modal content area scrolls independently so you can reach the full shortcode list and longer builder panels.

Common Attributes

Most shortcodes support these shared attributes:

Attribute Description Default
before Text added before the shortcode output. Empty
after Text added after the shortcode output. Empty
fallback Text used when the shortcode would otherwise return no value. Empty

Example:

[site_title before="Welcome to " after="!"]

Shortcode Reference

Date & Time

[current_year]

Outputs the current year.

Attributes:

Attribute Accepted values Default
format full, short full
offset Integer year offset 0

Examples:

[current_year]
[current_year format="short"]
[current_year offset="1"]

[current_month]

Outputs the current month.

Attributes:

Attribute Accepted values Default
format numeric, leading_zero, name, short leading_zero
offset Integer month offset 0

Examples:

[current_month]
[current_month format="name"]

[current_day]

Outputs the current day of the month.

Attributes:

Attribute Accepted values Default
format numeric, leading_zero leading_zero
offset Integer day offset 0

[current_date]

Outputs the current date using the site timezone.

Attributes:

Attribute Accepted values Default
format Any PHP date format string Site date format
offset Relative date string such as +1 day Empty

Examples:

[current_date]
[current_date format="F j, Y"]
[current_date offset="+1 week"]

[current_time]

Outputs the current time using the site timezone.

Attributes:

Attribute Accepted values Default
format Any PHP date format string Site time format
offset Relative time string such as +30 minutes Empty

[current_datetime]

Outputs the current date and time together.

Attributes:

Attribute Accepted values Default
format Any PHP date format string Site date format + time format
offset Relative date/time string Empty

[current_timestamp]

Outputs the current timestamp.

Attributes:

Attribute Accepted values Default
format unix, mysql unix
offset Relative date/time string Empty

[current_day_name]

Outputs the current weekday name.

Attributes:

Attribute Accepted values Default
format full, short full
offset Relative date string Empty

[current_month_name]

Outputs the current month name.

Attributes:

Attribute Accepted values Default
format full, short full
offset Relative date string Empty

[year_range]

Outputs a single year or a year range.

Attributes:

Attribute Accepted values Default
start Year such as 2020 Empty
end Year such as 2028, or current current
separator Plain text -

Example:

[year_range start="2020"]

Site Info

[site_title]

Outputs the WordPress site title.

Attributes:

Attribute Accepted values Default
linked yes, no no

Example:

[site_title linked="yes"]

[site_tagline]

Outputs the site tagline or description.

[site_url]

Outputs the WordPress site URL, or a clickable link.

[home_url]

Outputs the home URL, or a clickable link.

[theme_name]

Outputs the active theme name.

[theme_version]

Outputs the active theme version.

[wp_version]

Outputs the installed WordPress version.

These URL-style shortcodes support the same attributes:

Shortcode Extra attributes
[site_url] link_text, target, rel
[home_url] link_text, target, rel

Example:

[home_url link_text="Visit our homepage" target="_blank" rel="noopener"]

[site_domain]

Outputs the site domain only.

Attribute Accepted values Default
strip_www yes, no no

[admin_email]

Outputs the site admin email address.

[site_language]

Outputs the site language.

Attribute Accepted values Default
format locale, html html

[site_charset]

Outputs the configured site charset.

URLs & Navigation

These shortcodes support link_text, target, and rel when noted.

[login_url]

Outputs the login URL.

Attribute Accepted values Default
redirect Absolute or relative URL Empty
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

https://wellplayedwp.com/wp-login.php?action=logout&_wpnonce=ddee94a9f2

Outputs the logout URL.

Attributes are the same as [login_url].

https://wellplayedwp.com/wp-login.php?action=lostpassword

Outputs the password reset URL.

Attributes are the same as [login_url].

[register_url]

Outputs the registration URL when registration is available.

Attribute Accepted values Default
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

[privacy_policy_url]

Outputs the privacy policy page URL.

Attribute Accepted values Default
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

[current_url]

Outputs the full current page URL.

Attribute Accepted values Default
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

[request_path]

Outputs only the current request path.

Attribute Accepted values Default
trim_slashes yes, no no

[search_url]

Outputs a search URL.

Attribute Accepted values Default
query Plain text Empty
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

Example:

[search_url query="WordPress tips" link_text="Search now"]

[search_query]

Outputs the current search term.

Attribute Accepted values Default
default Plain text Empty

[archive_url]

Outputs an archive URL for a post type.

Attribute Accepted values Default
post_type Registered post type slug Current post type, then post
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

Post & Content

These shortcodes use the current post by default. If you pass an id attribute, the shortcode will use that post instead.

[post_id]

Outputs the current or selected post ID.

Attribute Accepted values Default
id Post ID integer Current post

[post_title]

Outputs the current or selected post title.

Attribute Accepted values Default
id Post ID integer Current post
linked yes, no no

[post_excerpt]

Outputs the current or selected post excerpt.

Attribute Accepted values Default
id Post ID integer Current post
words Integer Empty
more Plain text ...

[post_url]

Outputs the current or selected post permalink.

Attribute Accepted values Default
id Post ID integer Current post
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

[post_date]

Outputs the publish date.

Attribute Accepted values Default
id Post ID integer Current post
format PHP date format string Site date format

[post_modified_date]

Outputs the modified date.

Attribute Accepted values Default
id Post ID integer Current post
format PHP date format string Site date format

[post_author]

Outputs a field from the post author.

Attribute Accepted values Default
id Post ID integer Current post
field display_name, user_login, user_email, first_name, last_name display_name

[post_type]

Outputs the post type slug.

Attribute Accepted values Default
id Post ID integer Current post

[post_terms]

Outputs terms from a taxonomy.

Attribute Accepted values Default
id Post ID integer Current post
taxonomy Registered taxonomy slug category
separator Plain text ,
links yes, no no
target _self, _blank _self
rel Plain text Empty

Example:

[post_terms taxonomy="category" links="yes"]

[featured_image_url]

Outputs the featured image URL.

Attribute Accepted values Default
id Post ID integer Current post
size Registered image size slug full
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

User Context

These shortcodes use the logged-in user by default. You can also target a specific user with user_id.

[current_user_id]

Outputs the user ID.

[current_user_display_name]

Outputs the display name.

[current_user_first_name]

Outputs the first name.

[current_user_last_name]

Outputs the last name.

[current_user_email]

Outputs the email address.

[current_user_role]

Outputs the first assigned role.

For all six shortcodes above:

Attribute Accepted values Default
user_id User ID integer Current logged-in user

If no user is available, these shortcodes return an empty value unless you provide fallback.

[is_user_logged_in]

Outputs different text based on login status.

Attribute Accepted values Default
logged_in Plain text yes
logged_out Plain text no

Example:

[is_user_logged_in logged_in="Welcome back" logged_out="Please sign in"]

WooCommerce

WooCommerce shortcodes only work when WooCommerce is active. If WooCommerce is not active, or the required cart or product context is missing, the shortcode returns an empty value unless noted otherwise.

[wc_cart_count]

Outputs the number of items in the cart.

Attribute Accepted values Default
format number, text number

[wc_cart_total]

Outputs the cart total.

Attribute Accepted values Default
empty Plain text Empty

[wc_shop_url]

Outputs the WooCommerce shop page URL.

[wc_checkout_url]

Outputs the checkout URL.

[wc_my_account_url]

Outputs the My Account URL.

For the three URL shortcodes above:

Attribute Accepted values Default
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

[wc_product_price]

Outputs the product price for the current or selected product.

Attribute Accepted values Default
id Product ID integer Current product
include_prefix yes, no yes

[wc_product_sku]

Outputs the product SKU.

Attribute Accepted values Default
id Product ID integer Current product

[wc_product_stock]

Outputs stock information.

Attribute Accepted values Default
id Product ID integer Current product
format text, slug text

[wc_product_add_to_cart_url]

Outputs an add-to-cart URL.

Attribute Accepted values Default
id Product ID integer Current product
link_text Plain text Empty
target _self, _blank _self
rel Plain text Empty

Examples:

[wc_cart_count format="text"]
[wc_product_price id="123"]
[wc_product_add_to_cart_url id="123" link_text="Add to cart"]

Advanced & Misc

[query_var]

Outputs the value of a WordPress query variable.

Attribute Accepted values Default
key Query var slug Empty

Example:

[query_var key="paged"]

Copyright © 2026 WellPlayedWP

Outputs a copyright line.

Attribute Accepted values Default
start Year such as 2020 Empty
end Year such as 2028 or current current
holder Plain text Site title
prefix Plain text Copyright
symbol Any text such as © or Copyright ©
separator Plain text -

Example:

Copyright © 2020-2026 Acme Inc.

Output Notes

  • Text-based shortcodes are escaped for safe output.
  • Link-generating shortcodes can either output the raw URL or a clickable anchor when link_text is provided.
  • HTML-producing shortcodes such as WooCommerce price output are sanitized before display.
  • When a shortcode has no usable value, fallback is used if provided.

Uninstalling

Deleting Shortcode Galaxy removes the plugin-owned enabled shortcode option from the site. Content that already contains shortcode tags is not modified.

Troubleshooting

A shortcode does not work

Check the following:

  • The shortcode is enabled in Settings > Shortcode Galaxy
  • The shortcode tag is spelled correctly
  • The current page has the right context, such as a post, logged-in user, search query, or WooCommerce product

A WooCommerce shortcode is blank

This usually means one of these is true:

  • WooCommerce is not active
  • There is no cart yet
  • The page is not in a product context
  • A specific product ID was not supplied

The shortcode shows nothing

Some shortcodes depend on the current page context. When needed, pass attributes like id, user_id, key, or post_type, or use the fallback attribute.

Developers

Shortcode Galaxy is primarily aimed at site builders and content editors.

Current developer-facing notes:

  • The plugin does not currently register custom action hooks or filter hooks for third-party extensions.
  • The available shortcode set is the built-in library shown on the settings screen and in this document.
  • If you are integrating the plugin into custom site code, treat the built-in shortcode tags and their documented attributes as the public interface.

Changelog

1.0.1 – 2026-06-01

  • Add uninstall cleanup for the plugin-owned enabled shortcode option.
  • Fix the WellPlayedWP Library plugin-row notice so it works even when another plugin loads the shared updater class first.
  • Fix release metadata and changelog formatting for readme compatibility.
  • Document uninstall behavior in the plugin documentation.

1.0.0 – 2026-04-15

  • Add an Elementor sidebar launcher for the shortcode widget builder.
  • Fix Elementor shortcode builder modal contrast in dark mode.
  • Fix Elementor shortcode builder modal scrolling for longer shortcode lists and builder panels.
  • Add direct shortcode builder access from both the block editor toolbar and Elementor shortcode widget editing.
  • Document the new Elementor shortcode widget workflow.