In this article, I explain how you can create an FAQ chatbot based on the content of your WordPress website.
The basic idea
Inside a Dialogflow intent, you need 3 things (at the minimum):
- the name of the intent
- a set of training phrases
- a set of responses
And the name of the intent should be unique.
When you are creating an FAQ bot out of your WordPress website, you need to figure out the following:
- how to name the intents?
- how to generate the training phrases?
- how to generate the responses?
Now, it is quite likely that the response is just a link to the post or article you have written.
For the name, we will use the Slug which is auto-generated by WordPress when you try to publish the post. Since WordPress takes care of keeping the slug unique, plus the slug is usually quite readable, that would be a good option.
What about training phrases?
My view is that if you have a website with a reasonable number of articles, and you have done a good job of internal linking, the anchor text you have used across your website is a very good source of training phrases.
If you are not clear what anchor text is, I recommend Ahrefs detailed article on anchor text. (By the way, think of the anchor text I used in this link as you read this section).
From the Ahref's article, we see that there are seven types of anchor text:
Let us consider the first three types of anchor texts. These are typically good choices for Dialogflow training phrases.
(The article also concludes that you should NOT try to manipulate your anchor text at all and let Google - which is smart enough at this point - to figure it out.)
So what we will do is to use the anchor text that you are already using as the training phrase for the given page (i.e. given intent).
What good anchor text looks like (according to the experts)
Now, this is based on Moz's article on anchor text best practices.
Are these actually best practices for SEO? Honestly, I am not an SEO expert, and I don't have the slightest clue. 😉
All I know is that this is what SEO experts seem to think. But, it is a pretty useful starting point for our purpose here.
For your Dialogflow agent, this may not be a good thing. You want to be elaborate with your training phrases, so you can cover a wider surface area of possible word matches.
Relevant to the linked page
This is kind of obvious. Yes, you should do that.
Low keyword density
Hmm.. I don't know if that is a good idea for your Dialogflow based chatbot. The more keyword dense it is, the better the odds of a good intent match.
Yes, this is a good idea for your Dialogflow chatbot, although for a different reason. The most common generic anchor text is probably "click here" which you have most likely used when pointing to multiple articles on your website.
Unfortunately, this means there are now two intents in your Dialogflow agent with the same unhelpful training phrase "click here", and Dialogflow is basically going to do an inky-pinky-ponky when selecting one of the intents.
Although, thankfully, almost certainly no one is going to type "click here" into your chatbot. 🙂
So there you go. That's what you are looking at if you try to convert your anchor text into training phrases. While that may not seem very promising, it is still a good place to start.
This brings me to the second point to consider - how good is your internal linking?
Interestingly, if you use Yoast's premium SEO plugin, it will show you how many pages and posts on your site are "orphaned" - that is, have nothing at all linking to them.
This is, of course, bad news for our anchor text strategy. So should you just go on a frenzy of inter-linking your orphaned content?
I don't know what is best for your SEO, but here is something to consider: if you have never linked to the post till date, odds are that it is an unimportant page on your site. Which is great! Less work to do when it comes to creating your actual bot!
In fact, the Yoast SEO plugin also recommends articles for internal linking as you are writing the article.
I am just not convinced about the algorithm it uses for these suggestions, though. 🙂
But that was still some free advertising for Yoast's premium plugin, because you now know that you can add more internal links to your articles without going through your huge archive and tearing your hair out trying to find the relevant ones.
More relevant, thoughtful internal links = more easily generated training phrases for your Dialogflow bot.
How to get all these internal links?
In case you don't know, you can export all your WordPress content into an XML file.
Go to Tools -> Export.
Inside this XML file, you can find the actual content of your posts with all the associated HTML. This means, of course, that you can actually automate a bunch of this stuff!
In the next installment of this article, I will explain how you can do this automation.
- BotFlo vs Dialogflow CSV Importer
- Build Better Dialogflow Bots
- Deploy NodeJS Webhook to Google Cloud
- Dialogflow Firebase Tutorial
- Reader Question: Is there a feedback mechanism to like and dislike a Dialogflow response?
- How to debug your Dialogflow bot
- Client Question: Can I use GPT2 for my Dialogflow bot?
- Free Mini Courses
- 15 things all Dialogflow bot makers should know
- Autogenerating FAQ bot from training text