The new URL for the REST API endpoints contain the prefix as well as a namespace like this:
If you don’t like the default base prefix and want to change it from
wp-json to something more beautiful, the code snippet will help you to change the base prefix from
As soon as you are done adding the above snippet, you have to flush rewrite rules by resaving permalinks from
Settings > Permalinks to access all the data from your new api like this:
Want to learn about WP REST API? You can read the handbook here.