Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to customise the WordPress REST API URL prefix (wp-json). This snippet is for the blog post.
// This will replace the 'wp-json' REST API prefix with 'api'.
// Be sure to flush your rewrite rules for this change to work.
add_filter( 'rest_url_prefix', function () {
return 'api';
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment