USP Pro enables you to customize any of the email alerts and also contact forms with Email Shortcodes (aka shortcut variables).

Email Shortcodes bring dynamic functionality to your alert and email messages. Here is a list of shortcodes that may be included in either the email alert subject or the email alert message:

blog url              = %%blog_url%%	
blog name             = %%blog_name%%
admin name            = %%admin_name%%
admin email           = %%admin_email%%
user name             = %%user_name%%
user email            = %%user_email%%
post title            = %%post_title%%
post date             = %%post_date%%
post url              = %%post_url%%
post categories       = %%post_cats%%
post tags             = %%post_tags%%
post id               = %%post_id%%
post permalink slug   = %%post_slug%% (note: returns post ID until post is published)
post author           = %%post_author%%
post content          = %%post_content%%
custom fields         = %%post_custom%%
specific custom field = %%__custom-field-key%%
post submitted date   = %%post_submitted_date%%
post scheduled date   = %%post_scheduled_date%%
ip address            = %%ip_address%%
post edit link        = %%edit_link%%
post delete link      = %%delete_link%%
attached file urls    = %%files%%

These Email Shortcodes may be used for the following settings:

  • Email Alerts for Admin
  • Email Alerts for User
  • Contact Form Email

Additionally, two USP Filter Hooks are provided if you need to add a custom alert Shortcode:


Add your own!

USP Pro provides a couple of filter hooks that make it possible to add your own custom shortcode for email alerts. To do it, add the following code to your theme functions or add via custom plugin:

function usp_alert_shortcut_defined_pattern($pattern) {
	return '/%%current_year%%/'; // define shortcode name
add_filter('usp_alert_shortcut_defined_pattern', 'usp_alert_shortcut_defined_pattern');

function usp_alert_shortcut_defined_replacement($replace) { 
	return date('Y'); // define shortcode function
add_filter('usp_alert_shortcut_defined_replacement', 'usp_alert_shortcut_defined_replacement');

Once that code is in place, you can visit the email settings and add the following to your alert message:


That will include/display the current year (date) in each email alert. Of course, you can customize things to suit your needs. So you can include virtually any information in your email alerts.