Description
Sometimes in WooCommerce API bulk operations (add/edit/delete) are restricted. So it will give a error like
“Sorry, you are not allowed to batch manipulate this resource. [woocommerce_rest_cannot_batch]”
To resolve this error, follow this steps:
- Install & activate Code Snippet plugin in wordpress. https://wordpress.org/plugins/code-snippets/
- Go to Snippet -> Add New and add a new snippet
- The snippet will have below written codes:add_filter( ‘woocommerce_rest_check_permissions’, ‘allow_bulk_operation’, 10, 4 ); function allow_bulk_operation( $permission, $context, $object_id, $type ) { return true; }
- Save & Activate it.
Now it will allow the bulk operation from API.
If you want to understand it better, check this link: https://wordpress.org/support/topic/restrict-endpoint-on-woocommerce-rest-api/
Reviews
There are no reviews yet.