Skip to main content

better_messages_my_messages_url

A URL-only shortcode that returns the path to the logged-in user's inbox. Doesn't render any UI — just the URL string. Designed for use cases where you need the inbox URL as a link target (menu items, buttons, custom dashboard widgets) without embedding the full messenger.

When to use it#

ScenarioPattern
WordPress menu link to MessagesUse this shortcode with the Shortcode in Menus plugin
Custom dashboard "View Inbox" buttonWrap the URL in your own anchor tag
Account-page link listAdd as one item in a user's account-actions list
Author bio "Message me" linkURL-only with custom button styling

Usage#

[better_messages_my_messages_url]

Returns the URL of the page where the messenger lives — typically /messages/ or wherever WP Admin → Better Messages → Settings → General → Messages Location points.

In a menu (via Shortcode in Menus)#

  1. Install Shortcode in Menus
  2. Appearance → Menus → Add a Custom Link
  3. URL: [better_messages_my_messages_url]
  4. Label: "Messages"

When rendered, the URL placeholder is replaced with the actual inbox URL.

In a custom anchor#

<a class="btn btn-primary" href="[better_messages_my_messages_url]">
View My Messages
</a>

The shortcode renders to the bare URL — wrap it in any element you want.

Frequently asked questions#

What URL does this return for non-logged-in users?#

An empty string. The shortcode only resolves a URL for authenticated users (logged-in WordPress users or authenticated guests). Wrap the shortcode with a login link in your template if you need to redirect anonymous visitors somewhere meaningful.

Does this return a relative or absolute URL?#

Absolute URL — full https://yoursite.com/messages/ form. Useful for emails and external links.

Can I include this in an email template?#

Yes — though emails typically use a different anchor (each thread has its own deep-link URL). For "view all my messages" links in transactional emails, this is useful.

See also#