Skip to content
No results
  • Admin Panel
  • Security
  • Optimization
  • WooCommerce
    • General
    • Products
    • Coupon
    • Cart & Checkout
  • Management
  • Content
  • Media
  • Elementor
  • Gutenberg
Snipjar
No results
  • Admin Panel
  • Security
  • Optimization
  • WooCommerce
    • General
    • Products
    • Coupon
    • Cart & Checkout
  • Management
  • Content
  • Media
  • Elementor
  • Gutenberg
Snipjar
  • Security

Disable WordPress REST API

add_filter(
	'rest_authentication_errors',
	function ( $access ) {
		return new WP_Error(
			'rest_disabled',
			__( 'The WordPress REST API has been disabled.' ),
			array(
				'status' => rest_authorization_required_code(),
			)
		);
	}
);
Previous Post Completely disable comments for all post types, in the admin and the frontend
Next Post Disable attachment pages
  • Privacy Policy

Curated with ❤️ by Snipjar.