· · ·

How I Built a Daily Affirmations Generator for My WordPress Site using ChatGPT

Sometimes the simplest projects are the most powerful. I wanted a way to share a positive word or affirmation each day on my website. Here’s exactly how I did it…

Sometimes the simplest projects are the most powerful. I wanted a way to share a positive word or affirmation each day on my website.

Here’s exactly how I did it using ChatGPT!

Step 1: Prompt ChatGPT to create an custom HTML code that will generate Daily Affirmations everyday.

I started by creating a prompt that would would embed into my WordPress site. I didn’t want a plugin so I chose to do a JavaScript Snippet. I used the following prompt:

“Create custom HTML code for a WordPress Website that will allow me to generate a word of Positivity/Affirmations each day.”

Print out: A custom Lightweight JavaScript Snippet to put into a Widget/Custom HTML block!

This small script randomly selects one affirmation each day based on the array of affirmations given.

Step 2: List of Affirmations

I wanted a longer list of affirmations, so I started by prompting ChatGPT to

“Give me a list of 150 daily affirmations or positive growth mindset statements to be added in the array, so use quotes and separate by commas”

Printout:

This format made it super easy to copy and paste into the code!

Step 3: Add to WordPress

Within the editing feature of your site, add a CUSTOM HTML block for where you want your daily affirmations generator. Paste the code, save, and Voila!

Step 4: Display It

I placed the shortcode inside a CUSTOM HTML block on my homepage footbar. Now, every day when visitors come to my site, they see a fresh word of encouragement waiting for them!


Now my site delivers a daily affirmation, and I love knowing it might brighten someone’s day!

What do you think, should I customize the style and make it have a fresh look?