Reinvent WP
PluginsSuite Pass
Text to Speech for Ghost

Add text to speech to your Ghost blog

One snippet in Ghost adds a Listen button to every post. Natural AI voices read the post aloud and highlight each word as it is spoken.

40,000 characters free for 14 days. No credit card. No theme files to edit.

yourblog.ghost.io/the-slow-art-of-sourdough

The slow art of sourdough

Good bread is mostly waiting. You mix flour, water and salt, and then time does the work that no machine can hurry.

A loaf that rests overnight tastes deeper, keeps longer and is easier to digest.

Live demo: press play. This is the real player.

Three steps. No theme files to edit.

Tested on Ghost 6.79 with the Source and Casper themes.

Get your public site key

Start the free trial with your blog's address: 40,000 characters of hosted voices for 14 days, no credit card. Then copy the public site key from the Text to Speech dashboard.

Your key looks like this

rwp_public_…Start free trial

Paste the snippet into Ghost

In Ghost Admin, go to:
Settings
Advanced
Code injection
Open
Site footer
Put your key in the snippet, paste it into the Site footer box and press Save. You never open a theme file.
<script>
  (function () {
    var postBody = ".post-template .gh-content"; // where your post's text is
    if (!document.querySelector(postBody)) return; // not a post: load nothing

    window.ReinventTTSConfig = {
      publicKey: "rwp_public_xxx", // your public site key
      selector: postBody,
      mount: postBody,
      mount_position: "prepend",
      pluginConfig: { audio_source: "reinventwp_pro", read_title: true }
    };

    var script = document.createElement("script");
    script.src = "https://reinventwp.com/js/text-to-speech/latest.js";
    document.body.appendChild(script);
  })();
</script>
Ghost settings: the Code injection card with its Open buttonGhost Code injection, Site footer tab, with the Text to Speech snippet pasted in

Open a post

Open any published post. The player sits above the first paragraph. Press play: the post is read aloud and each word lights up as it is spoken.
A Ghost post with the Text to Speech player above the first paragraph, reading it and highlighting a word

If something looks wrong

The player doesn't show up

Your theme may name the post's text differently. Ghost's own themes use gh-content. Open a post, right-click the first paragraph and choose Inspect, then find the element that wraps all the paragraphs. Put its class in the first line of the snippet, like this:

var postBody = ".post-template .your-class";

It says the public key cannot be used on this domain

The key only works on the addresses you allowed. Open your project on the Text to Speech dashboard and add your blog's address, with your custom domain if you use one.

The player shows up late

A CDN or speed tool that delays JavaScript delays the player too. Exclude this snippet from it, or the address of the script:

reinventwp.com/js/text-to-speech/latest.js

I want it on pages too

The snippet only runs on posts. To add the player to pages as well, shorten the first line to:

var postBody = ".gh-content";

Try it free. Pay when you're ready.

Get 40,000 hosted characters for 14 days. No credit card required.

Enter your website domain.

Hear the player on one of your articles first. No sign-up.

Want a different player, voice or language?

Every setting of the JavaScript player works in this snippet. Build yours with the code generator.

All settings

Join our community.

Ask questions, share implementation issues, and help shape the next Text to Speech examples.

Need a custom solution?

Running a high-traffic website or planning an enterprise integration? We can help you fit the technology to your application.

Discuss your project

reinventwp@gmail.com

Contact us

Tell us what you need. Include enough detail for us to understand your question and help you faster.

Prefer email? Write to support@reinventwp.com

0/2000 characters

By sending, you agree to share your email, website address, and message with Reinvent WP. Privacy Policy