With the AWS Plugin for WordPress

In this step-by-step tutorial you will use the AWS Plugin for WordPress to add text-to-speech capability to a WordPress installation. Amazon Polly is a service that uses advanced deep learning technologies to synthesize speech that sounds like a human voice, enabling you to create applications that talk, and build entirely new categories of speech-enabled products.

The AWS Plugin for WordPress example demostrates how content creators can easily add text-to-speech capabilities to any written content. With more and more search happening by voice, it’s essential to have more of your website’s content in audio formats. By adding voice capabilities, visitors to your websites can consume your content via new channels such as inline audio players and podcast applications.

You can add the AWS Plugin for WordPress to a WordPress installation that is set up on an EC2 instance, LightSail or hosted elsewhere. There are numerous options to create a WordPress installation on AWS. If you need a WordPress site on AWS, you can create one easily using LightSail, on EC2 using the Launch a WordPress Website 10-minute tutorial, or with a more advanced tutorial at Build a Wordpress Website project.

This tutorial requires an AWS account

Create a Free Account

Open the AWS Management Console and you can keep this step-by-step guide open. When the screen loads, enter your user name and password to get started. Then type an IAM in the search box, and press Enter to open the dashboard.

If you are hosting your WordPress site on EC2, use the EC2 instructions below.

If you are hosting your WordPress site on LightSail or not on AWS, use the LightSail instructions below.

  • EC2

    In this step, you will create an IAM policy, which is a document that defines permissions. Once you attach the IAM policy to an IAM EC2 role, and can assign this role to your EC2 based WordPress server.

    a. On the left-hand side of the screen, select Roles and then Create Role.

    tmt_tts-for-wordpress_1_EC2_d

    (click to zoom)

    tmt_tts-for-wordpress_1_EC2_d

    b. On the Create Role page, select AWS Service on the top. From the services list select EC2. From the Select your use case list, select EC2. Select Next: Permissions to continue to the next page.

    tmt_tts-for-wordpress_1_EC2_e

    (click to zoom)

    tmt_tts-for-wordpress_1_EC2_e

    c. On the Attach permissions policies page, in the search box type AWSForWordPressPluginPolicy, Select the checkbox next to the policy from the list and then select Next Review.

    tmt-tts-for-wordpress-1-ec2-c

    (click to zoom)

    tmt-tts-for-wordpress-1-ec2-c

    d. On the Review page, in the Rule name field, write PollyForWordPressRole, and then select Create role to continue.

    tmt_tts-for-wordpress_1_EC2_g

    (click to zoom)

    tmt_tts-for-wordpress_1_EC2_g

    e. Now you will assign the PollyForWordPressRole role to your WordPress EC2 instance. Select Services tab on the top of the page and then EC2 service.

    tmt_tts-for-wordpress_1_EC2_h

    (click to zoom)

    tmt_tts-for-wordpress_1_EC2_h

    f. Select Instances on the left-hand side, and choose your EC2 WordPress instance. From the Actions menu choose Instance Settings > Attach/Replace IAM Role.

    tmt_tts-for-wordpress_1_EC2_i

    (click to zoom)

    tmt_tts-for-wordpress_1_EC2_i

    g. In the next window, under IAM role field select PollyForWordPressRole role, which you have created before. Then click Apply.

    tmt_tts-for-wordpress_1_EC2_j

    (click to zoom)

    tmt_tts-for-wordpress_1_EC2_j
  • LightSail/Non-AWS Hosting

    In this step you will create an IAM user with special permissions, which will provide access to AWS services required for the plugin to work. The IAM user you create will receive AWS credentials, which are known as AWS Access Key and AWS Secret Key. You will use these keys in the plugin configuration page.

    a. On the left-hand side of the screen, select Users, and Add User.

    tmt_tts-for-wordpress_1_LS_d

    (click to zoom)

    tmt_tts-for-wordpress_1_LS_d

    b. On the first step of the wizard, provide the name of the new IAM User: AmazonPollyForWordPress, select Programmatic access and move to the next step of the wizard.

    tmt_tts-for-wordpress_1_LS_e

    (click to zoom)

    tmt_tts-for-wordpress_1_LS_e

    c. On the Attach permissions policies page, in the search box type AWSForWordPressPluginPolicy, Select the checkbox next to the policy from the list and then select Next Review.

    tmt-tts-for-wordpress-1-lightsail-c

    (click to zoom)

    tmt-tts-for-wordpress-1-lightsail-c

    d. On the third step of the wizard review the changes, select Create User and move to the final step.



    tmt_tts-for-wordpress_1_LS_g

    (click to zoom)

    tmt_tts-for-wordpress_1_LS_g

    e. On the last step of the wizard you will need to note down the IAM credentials for the new user. You can choose to Download .csv, or copy the Access Key Id and Secret Access Key manually. The information is required to configure the AWS Plugin for WordPress later.

     

    tmt_tts-for-wordpress_1_LS_h

    (click to zoom)

    tmt_tts-for-wordpress_1_LS_h

In this step, you will download and install the Amazon Polly plugin for WordPress.


a. Open your WordPress admin page and log in.

tmt_tts-for-wordpress_2a

(click to zoom)

tmt_tts-for-wordpress_2a

b. Select Plugins on the left-hand side, and Add New.

tmt_tts-for-wordpress_2b

(click to zoom)

tmt_tts-for-wordpress_2b

c. On Add Plugins Page, write AWS for WordPress in search box and press enter. Choose the AWS plugin and select Install Now.

tmt-tts-for-wordpress-2c

(click to zoom)

tmt-tts-for-wordpress-2c

d. Select Activate to activate the plugin.

tmt-tts-for-wordpress-2d

(click to zoom)

tmt-tts-for-wordpress-2d

If you are hosting your WordPress site on EC2, use the EC2 instructions below.

If you are hosting your WordPress site on LightSail (or elsewhere outside of AWS), choose the LightSail instructions below.

  • EC2

    Congratulations, the plugin is installed! The plugin will work without additional configuration, but there are many useful settings. For example, you can select different Amazon Polly voices for the audio output, or enable podcast capabilities through Amazon Pollycast feeds. Let's see how to get to the plugin configuration page.

    Select AWS on the left-hand side and choose Text-To-Speech. On this page enable text-to-speech functionality and click on Save Changes. Now you should see that other settings are available, and you can change them also. For example, under Voice Name, you can choose from a wide selection of voices to articulate the audio content.

    tmt-tts-for-wordpress-3-ec2-a

    (click to zoom)

    tmt-tts-for-wordpress-3-ec2-a
  • LightSail/Non-AWS Hosting

    Congratulations, the plugin is installed! The plugin will work without additional configuration but there are many useful settings. For example, you can select different Amazon Polly voices for the audio output, or enable podcast capabilities through Amazon Pollycast feeds. Let's see how to get to the plugin configuration page!

    a. Select AWS on the left-hand side and choose General. You will need to provide your AWS credentials, so that the plugin would have access to AWS services which it uses. In AWS Access Key and AWS Secret Key fields, enter the credentials which you downloaded in the .csv in previous steps of this tutorial. Click on Save Changes to the save the changes.

    tmt-tts-for-wordpress-3-LS-a

    (click to zoom)

    tmt-tts-for-wordpress-3-LS-a

    b. Select AWS on the left-hand side and choose Text-To-Speech. On this page enable text-to-speech functionality and click on Save Changes. Now you should see that other settings are available, and you can change them also. For example, under Voice Name, you can choose from a wide selection of voices to articulate the audio content.

    tmt-tts-for-wordpress-3-LS-b

    (click to zoom)

    tmt-tts-for-wordpress-3-LS-b

At this stage, everything is done and your new web content will be made available to your readers in audio format. Now you can create a new blog post and see if you are able to hear the audio content.


a. Select Posts on the left-hand side and then Add New to open wizard for creating new post. Write your own blog post with title and content. Still on this same screen, click on the Enable Amazon Polly checkbox. And then select Publish to save the new post.

tmt_tts-for-wordpress_4a

(click to zoom)

tmt_tts-for-wordpress_4a

b. Open your WordPress site. You should now see a new post with an embedded player. Click the Play button and listen to the voiced article.  

Note: In addition to the HTML embedded player available on WordPress site, you can also enable podcast capabilities via the Amazon Pollycast feeds. These feeds are RSS 2.0 compliant and provide necessary XML data for aggregation by popular Podcast mobile applications and podcast directories such as iTunes. Read the AWS AI Blog for more details!

tmt_tts-for-wordpress_4b

(click to zoom)

tmt_tts-for-wordpress_4b

You can now easily voice your WordPress content with the Amazon Polly plugin. To do something a bit more dynamic, use the Amazon Polly API to access the full set of features such as custom pronunciation, lip-syncing and text highlighting. With dozens of natural sounding voices across a variety of languages, you can select the ideal voice and build speech-enabled applications that work in many different countries.

Now that you have tried Amazon Polly, pick one of the following options to further expand your knowledge.

Webpage

Visit Amazon Polly to find out more about the text-to-speech service.

Documentation

Read the developer guide for detailed instructions on using the various Amazon Polly features. 

AI Blog

Get the latest updates and customer stories related to Amazon Polly

Yes
No