Automate tasks with WordPress
WordPress is an online, open source website creation tool. It's probably the easiest and most powerful blogging and website content management system (or CMS) in existence today.
https://www.wordpress.com
Triggers
The trigger is the event that starts the automation.
-
If there's a new Post
It is triggered every time there is a new blog post.
- You can apply only to posts that contain one or more specific tags.
- You can apply only to posts that belong to one or more specific categories.
-
If page don't exists
Actions
The action is what happens automatically, without you having to do anything else.
-
Create a new Post
-
Search a post by its slug
Allows you to search for an entry based on the slug and the type of entry (Public, Draft, Private, etc).
-
Update a Post
Updates the data of an entry from its ID.
-
Get Post Metas
Get the meta of an entry from its ID.
-
Get an item from Media Library
Gets information about a file from the media library based on its Id.
-
Update Post metas
Updates the metas of an entry from its ID.
-
Create a media item
Add up to 5 media files in the library
-
Create a new Page
-
Search a page by its slug
-
Update a Page
-
Update Site Settings
Tutorials
Guide to obtain the credentials to automate WordPress.
Frequently Asked Questions
The error 'Error 301: permanent redirection response code' occurs
It is possible that the API of your WordPress website is not accessible. One way to check this would be to go to https://DomainName.com/wp-json/wp/v2/posts/?per_page=1 and see if you receive a response in JSON format, which would mean that the API is enabled correctly.
You may need to check your server's .htaccess and wp-config.php files and look for any rule that might be disabling API access.
The error 'rest_invalid_param. Invalid parameter(s): status' occurs
The error 'rest_invalid_param. Invalid parameter(s): status' in WordPress can appear for two reasons.
- 1. User with insufficient permissions.
One of the reasons is related to the user permissions. The user type selected to access the API doesn't have permissions to read, modify, or create entries with the selected status type (for example, 'private').
In your WordPress admin panel, change the user type to one with sufficient permissions.
- 2. Incomplete .htaccess file
Another reason why the error 'rest_invalid_param. Invalid parameter(s): status' may appear is due to an incorrect configuration of the .htaccess file that is preventing authentication requests to the WordPress REST API. To resolve this issue, edit the .htaccess file on your WordPress server and ensure the following are present to enable the authorization header in the WordPress REST API:
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
To edit the .htaccess file, you can access it through your web server control panel or via an FTP client. Make sure to backup the file before making any changes.
How to specify categories in posts?
To assign categories to a post when adding or modifying it in your WordPress, use the field called 'Category IDs' in the automatic task.
You must specify the desired category IDs, separated by commas. It is important that you use the numeric IDs and not the names of the categories. Before carrying out this operation, you will need to access your WordPress to identify the ID associated with each category you are interested in. This will ensure that the posts are correctly classified under the appropriate categories.
Common Errors
Error: rest_cannot_create. Lo siento, no tienes permisos con este usuario para crear entradas.
The 'rest_cannot_create' error in WordPress can occur for two reasons.
- 1. Insufficient permissions for user.
One of the reasons is related to user permissions. The type of user selected to access the API does not have permission to create new entries on the page. For example, the 'Subscriber' user will not have permission to create new entries, while the 'Editor' or 'Administrator' users will have permission.
To resolve this, change the user type in your WordPress admin panel to one with sufficient permissions.
- 2. Incomplete .htaccess file.
Another reason why the 'rest_cannot_create' error may appear in WordPress is due to incorrect configuration of the .htaccess file, which may be blocking REST API requests. To resolve this problem, edit the .htaccess file on your WordPress server and check that the following lines are present to enable the authorization header in the WordPress REST API:
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
To edit the .htaccess file, you can access it through your web server control panel or via an FTP client. Make sure to back up the file before making any changes.
- 3. Blocked by security plugin or firewall.
Sometimes, a WordPress security plugin or a firewall rule from your hosting provider may block access to the WordPress REST API, preventing Botize from connecting properly.
To resolve this, try the following:
1. Temporarily disable any security plugins you have installed in WordPress and check if the issue persists. If the error disappears, the plugin may be blocking access to Botize.
2. Review the firewall rules and restrictions in your hosting control panel. Ensure that remote access with authentication to the WordPress REST API is allowed. If you're unsure, contact your hosting provider to enable this access.