Skip to content
GPLWP Guides

How to add text-to-speech to WordPress

Content Time About 30 minutes 6 steps Updated 13 Nov 2026

CONTENT
The short answer

You can add browser-based text-to-speech with JavaScript, but it will not create downloadable audio files and voice support varies by browser. For multilingual audio, reusable players, analytics or consistent playback, use a text-to-speech plugin.

The route
  1. 01Choose the audio approach
  2. 02Prepare the article content
  3. 03Build the manual browser version
  4. 04Handle the manual route’s limits
  5. 05Install and configure a plugin
  6. 06Test playback before publishing

What you need

  • WordPress administrator access
  • A child theme or small custom plugin for manual JavaScript
  • A backup or staging copy of the site
  • The articles or post types you want to make listenable

Choose the audio approach

Decide whether visitors should hear content through their own browser or whether your site should serve generated audio. Browser speech is quick and can avoid an external service, but voices, language support and pronunciation depend on the visitor’s device and browser. The Web Speech API exposes speech synthesis through JavaScript, including voice selection, rate and pitch controls.

Use generated audio when you need consistent playback, downloadable files, multilingual narration, analytics or audio that remains available after the page has loaded. A browser-only approach does not create an MP3 for visitors to download.

Prepare the article content

Decide exactly what should be read. Use the article’s main content container rather than the whole page, otherwise the player may read navigation, cookie notices, comments or related-post links. Give the content area a stable class or selector that your script or plugin can target.

Keep a normal text version on the page. Text-to-speech is an additional way to access content, not a replacement for headings, readable HTML, keyboard access or screen-reader support.

Build the manual browser version

For a no-service implementation, add a visible button and JavaScript through a child theme or a small custom plugin. The script should collect the text from the article container, create a SpeechSynthesisUtterance, and send it to speechSynthesis.speak(). Add separate controls for pause, resume and stop, using the corresponding speech-synthesis methods.

Load available voices with speechSynthesis.getVoices(), then refresh the voice list when the browser fires voiceschanged. Provide sensible defaults for language, rate and pitch, and handle browsers that return no voices or do not expose speech synthesis.

Handle the manual route’s limits

Test the browser version in Chrome, Edge, Safari and Firefox on both desktop and mobile. The API is widely available, but the actual voice list and voice quality vary by browser, operating system and installed language packs. Some browsers also populate voices asynchronously, so a voice dropdown can be empty until the voices list changes.

Do not put script tags directly into a post or page. WordPress may remove them, and allowing arbitrary script in content creates a security risk. The manual approach also leaves you responsible for selectors, player styling, keyboard focus, content changes and troubleshooting conflicts with caching or page-builder markup.

Install and configure a plugin

If you need a maintainable site-wide setup, install a text-to-speech plugin from Plugins in the WordPress dashboard, activate it, and choose which post types should receive a player. Configure the default language, voice, reading speed, pitch and player position, then use a block or shortcode when you want the player in a specific location. Many plugins can automatically add players to posts and pages, while shortcode-based tools give you more control over placement.

If the plugin generates audio through a third-party service, add the required API key in its settings rather than in an article or page. Check whether audio is generated when you publish, on demand, or only after you manually start a conversion. Keep an eye on usage limits and privacy disclosures.

Test playback before publishing

Open a published post as a visitor and test play, pause, resume and stop. Check that the player reads only the intended article, that headings and lists sound in the right order, and that the button has a clear label and visible keyboard focus.

Test a short post, a long post, a multilingual post and a post containing links, quotes, tables or page-builder elements. If generated audio is stale after editing an article, regenerate it or enable the plugin’s update-on-change option where available. If the main requirement is multilingual voices, adjustable speed and pitch, an embeddable player and engagement tracking, Speaker is a suitable plugin route for this job.

The fast route

Let Speaker do it

Converts posts and pages into multilingual audio with adjustable voices, speed, and pitch for accessible listening.

Get Speaker

Sources

  1. developer.mozilla.org /en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API?…
  2. wordpress.org /plugins/gspeech/?utm_source=openai

Questions

Can WordPress add text-to-speech without a plugin?
Yes, but you need custom JavaScript rather than a WordPress setting. The script can use the browser’s Web Speech API to read the article text with a selected voice, rate and pitch. This route is suitable for a simple listen button, but it depends on each visitor’s browser and device, does not normally create an MP3, and requires you to maintain the controls and content selector.
Does browser text-to-speech create an audio file?
No, browser text-to-speech normally speaks the text directly through the visitor’s device. It does not automatically save an MP3 or provide consistent audio across devices. If you need downloadable or cached audio, use a service or plugin that generates and stores audio files, then adds an HTML audio player to the post or page.
Why is the voice list empty in a custom WordPress text-to-speech player?
The voice list may be empty because browsers can load voices asynchronously. Call the voice-list function when the page loads and refresh it when the browser’s voices-changed event fires. Also check the visitor’s operating system language packs. Voice availability and names differ between browsers, so do not rely on one hard-coded voice name.
Can text-to-speech read only the article and not the whole page?
Yes, target the article’s main content container and pass only its text to the speech engine. Do not target the body element, because that can include navigation, cookie notices, comments and related content. With a plugin, use its content inclusion or exclusion settings, shortcode placement, or a documented content selector where available.
Is a text-to-speech player a replacement for accessibility?
No, it is an additional listening option. Keep semantic headings, readable text, keyboard-accessible controls, useful link labels and sufficient colour contrast. A browser voice may be unavailable or unsuitable for some visitors, and screen-reader users may prefer the page’s normal accessible HTML.