2
0
Files
bot/apps/docs/deploy/web/wordpress.mdx
2023-12-22 09:13:53 +01:00

77 lines
2.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: WordPress
---
Typebot has a native [WordPress plug-in](https://wordpress.org/plugins/typebot/) that helps you embed typebots in your WordPress site.
Of course, before using it, you need to create and publish your first typebot.
<Frame>
<img src="/images/embeddings/wordpress-preview.png" alt="WP plugin preview" />
</Frame>
The code snippet to paste is easily configurable in the Share tab of your bot after clicking on the "Wordpress" button.
## Excluded pages
The excluded pages input is a comma-separated list of pages where you don't want your typebot to appear.
Examples:
- `/app/*` will exclude all pages starting with `/app/`
- `/app` will only exclude the `/app` page
- `/app?param=1` will only exclude the `/app` page **and** with the `param` query parameter set to `1`
- `/app?param=*` will exclude the page at `/app` **and** with the `param` query parameter set to anything
- `/app/*?param=*` will exclude all pages starting with `/app/` **and** with the `param` query parameter set to anything
## Personalize user experience
You can leverage the [prefilled variables](../../editor/variables#prefilled-variables) and inject your user information directly into your typebot so that the experience is entirely customized to your user.
Here are the available variables from WordPress, make sure to create them in your typebot's variables dropdown:
<Frame style={{ maxWidth: '400px' }}>
<img
src="/images/embeddings/wp-variables.png"
alt="WP predefined variables"
/>
</Frame>
The only thing you need to do to enable this is:
- Use the [Wordpress Typebot plugin](https://wordpress.com/plugins/typebot)
- Have the variables declared in your Typebot with the exact syntaxes. For the email for example, make sure your variable is spelled `WP Email`. These won't work: `wp Email`, `WP email`.
## Your typebot isn't showing?
### You have litespeed with "Localise Resources" enabled
There is an a box where there is a list of URLs it localises, one of them was https://cdn.jsdelivr.net. This URL should be removed from it since it is used to import the embed library.
## You have litespeed with cache enabled
Make sure to insert `web.js` and `typebot` in the JS Excludes textbox and JS Deferred Excludes under Tuning Settings.
### You have a cache plugin
Plugins like WP Rocket prevent Typebot to work.
For WP Rocket:
1. Go to Settings > WP Rocket > Excluded Inline Javascript:
<Frame>
<img src="/images/embeddings/wp-rocket.png" alt="WP Rocket" />
</Frame>
2. Type "typebot"
3. Save
### You have plugin that adds `defer` attribute to external scripts
You need to add an exception for Typebot in the corresponding plugin config.
### Still not working
Contact me on the application using the typebot at the bottom right corner