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#
| Scenario | Pattern |
|---|---|
| WordPress menu link to Messages | Use this shortcode with the Shortcode in Menus plugin |
| Custom dashboard "View Inbox" button | Wrap the URL in your own anchor tag |
| Account-page link list | Add as one item in a user's account-actions list |
| Author bio "Message me" link | URL-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)#
- Install Shortcode in Menus
- Appearance → Menus → Add a Custom Link
- URL:
[better_messages_my_messages_url] - 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#
- better_messages — embed the full inbox UI
- better_messages_unread_counter — unread count for menus
- Easy customization — configure where the inbox lives