Add text to speech to your Shopify blog
One snippet in Shopify 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.
your-store.myshopify.com/blogs/news/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 a Shopify store with the Horizon theme (4.5.0), Shopify's default theme for new stores.
Get your public site key
Paste the snippet into Shopify
<script>
(function () {
var postBody = ".blog-post-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>


Open a post

If something looks wrong
The player doesn't show up
Your theme may name the post's text differently. Shopify's Horizon theme uses blog-post-content. Open a blog 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 = ".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 store's address, both your-store.myshopify.com and your own domain if you use one.
Some posts have no player
The Custom Liquid section belongs to one template. If some posts use another blog post template, open that template in the theme editor and add the same section there.
The player shows up late
An app 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.jsTry it free. Pay when you're ready.
Get 40,000 hosted characters for 14 days. No credit card required.
Not ready to start?
Want a different player, voice or language?
Every setting of the JavaScript player works in this snippet. Build yours with the code generator.
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.
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