WordPress REST API 404 Error: Cannot access the WordPress REST API

  1. Go to admin, settings, permalinks, choose “Post Name”
  2. Click “Save Changes”
  3. Browse to http://yoursitename.com/wp-json/wp/v2/posts
    • success. page displays JSON response