Shortcodes reference

5 min read

Three shortcodes are available. Most users only need [mementor-tts]. The other two are for advanced cases.

[mementor-tts]

The main audio shortcode. Wraps text that should be narrated and drops a player above the wrapped text.

Basic usage

[mementor-tts]Your text goes here.[/mementor-tts]

With attributes

[mementor-tts voice="IKne3meq5aSn9XLyUdCD" model="eleven_flash_v2_5" label="Listen to this" autoplay="no" download="yes" loop="no" time_display="yes" speed_control="yes" volume_control="yes" information="no"]
Your text goes here.
[/mementor-tts]

Attributes

Attribute Values Default Description
voice Voice ID site default Override the voice for this shortcode
model eleven_flash_v2_5, etc. site default Override the ElevenLabs model
label Any text empty Shows above the player
autoplay yes / no no Start playing on page load
download yes / no site default Show download button
loop yes / no no Loop the audio
time_display yes / no site default Show time and duration
speed_control yes / no site default Show speed selector
volume_control yes / no site default Show volume slider
information yes / no site default Show information icon

Examples

Simple audio block:

[mementor-tts]Hello, this is a test.[/mementor-tts]

Custom label and autoplay:

[mementor-tts label="Welcome message" autoplay="yes"]
Welcome to our site.
[/mementor-tts]

Different voice for a specific section:

[mementor-tts voice="EXAVITQu4vr4xnSDxMaL"]
This paragraph uses a different voice.
[/mementor-tts]

[tts_player]

Renders the audio player for an existing post's generated audio. Use this when you want to place the player in a non-default location using a shortcode.

Basic usage

[tts_player]

When placed inside a post or page, it references that post's audio. When placed in a template (via do_shortcode()), pass the post ID explicitly.

Attributes

Attribute Values Description
id post ID Reference a specific post's audio
lang lang code For multilingual sites, pick a language

Examples

Default (uses current post's audio):

[tts_player]

Specific post:

[tts_player id="123"]

Specific language (WPML/Weglot):

[tts_player id="123" lang="es"]

[mementor_raw]

Passes raw text through to ElevenLabs without TTSWP's standard cleanup (no CSS selector stripping, no shortcode escaping). Advanced use only.

Usage

[mementor_raw]
Your raw text that bypasses all TTSWP filters.
[/mementor_raw]

Use [mementor_raw] inside a [mementor-tts] block when you need precise control over what goes to synthesis:

[mementor-tts]
Intro sentence.
[mementor_raw]<phoneme alphabet="ipa" ph="təˈmeɪtoʊ">tomato</phoneme>[/mementor_raw]
Rest of the text.
[/mementor-tts]

In theme templates

To use any shortcode from a PHP template:

<?php echo do_shortcode('[tts_player id="' . get_the_ID() . '"]'); ?>