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?

The login URL is returned, with a redirect parameter pointing back to the messages page after login.

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.

Does the URL include any query parameters?

By default, no — just the base inbox path. Use the bp_better_messages_inbox_url filter to add custom params (e.g., utm tracking).

Will the URL work for guest users?

Guests don't have a personal inbox — the URL falls back to the chat room or guest landing page configured in settings.

See also