name spaces, hardening, blocking accessing to certain woocommerce rest apis
I've read this wpcerber section: https://wpcerber.com/restrict-access-to-wordpress-rest-api/
I have enabled: Block access to users' data via REST API as well as Block access to WordPress REST API except any of the following.
My namespaces show as follows:
{
"namespaces": [
"oembed/1.0",
"2fa/v1",
"contact-form-7/v1",
"yoast/v1",
"mc4wp/v1",
"wc/store",
"wc-analytics",
"wc-admin",
"testwp",
"elementor/v1",
"wc/v1",
"wc/v2",
"wc/v3",
"wccom-site/v1",
"wp/v2",
"wp-site-health/v1"
]
}
I want to allow Woo Rest API version 3 access and so I have tried adding wc/v3 as well as wc/v3/products to allowed namespaces
but when I try to access the api, I am getting the 401 message.
// 20201221161556
// https://fee8f3a621.nxcli.net/wp-json/wc/v3/products
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot list resources.",
"data": {
"status": 401
}
}
What am I doing wrong?
You have to add to the white list "wc", not "wc/v3". Meaning WP Cerber makes no distinction between versions in the namespaces. As a namespace, you have to specify the string before the first slash /.
Already have Cerber Security, Antispam & Malware Scan?
About Cerber Security, Antispam & Malware Scan
WP Cerber is a robust security solution that vigorously defends WordPress websites against hacker attacks, spam, and malware, while ensuring blazingly fast and reliable performance by design.
Our spe
With over 3 million reviews, we can provide the specific details that help you make an informed software buying decision for your business. Finding the right product is important, let us help.