- Help Center Home
- Getting started
- Introducing FacetWP
- Installation and updates
- FAQ
- How it works
- What are facets?
- Facet types
- Built-in facet types
- Checkboxes
- Dropdown
- Radio
- fSelect
- Hierarchy
- Slider
- Search
- Autocomplete
- Date Range
- Number Range
- Star Rating
- Proximity
- Pager + load more
- Sort
- Reset
- User Selections
- Add-on facet types
- Map
- Hierarchy Select
- Range List
- Time Since
- A-Z Listing
- Color
- Custom facet types
- Custom facet types
- Indexing
- Listing templates
- Extras & integrations
- Add-on features and extras
- Using FacetWP with …
- Built-in integrations
- Advanced Custom Fields
- WooCommerce
- SearchWP
- WP-CLI
- Add-on integrations
- Blocks
- Bricks
- Elementor
- Beaver Builder
- WP Recipe Maker and Tasty Recipes
- Relevanssi
- WPML and Polylang
- Meta Box
- Flatsome (theme)
- External integrations
- Breakdance
- Document Library Pro
- Listify (theme)
- Listable (theme)
- WPGraphQL
- Tips & tricks
- WordPress multi-site
- WP All Import
- WebToffee Import Export
- WP Job Manager
- Easy Digital Downloads
- EDD Reviews
- Intuitive Custom Post Order
- Custom Taxonomy Order
- Post Types Order
- Genesis framework
- WP External Links
- ElasticPress
- Yoast SEO
- All in One SEO (Pro)
- The Events Calendar Pro
- Google Analytics 4
- Image Optimization by Optimole
- Meow Lightbox
- Cookiebot
- Caching, hosting & security
- Object caching
- WP Rocket
- Cloudflare
- WP Engine
- Pressable
- New Relic
- WordPress REST API Authentication
- All-In-One Security (AIOS)
- Fast Velocity Minify
- Incompatibilities
- Incompatible plugins and themes
- Troubleshooting
- Troubleshooting guide
- Using the right query
- Common issues
- Common indexing issues
- Get support
- Developers
- Hooks reference
- Indexing hooks
- Querying hooks
- Output hooks
- facetwp_facet_display_value
- facetwp_facet_html
- facetwp_facet_render_args
- facetwp_facet_pager_link
- facetwp_facet_sort_options
- facetwp_template_html
- facetwp_shortcode_html
- facetwp_render_params
- facetwp_render_output
- facetwp_builder_item_value
- facetwp_builder_dynamic_tags
- facetwp_builder_dynamic_tag_value
- Advanced hooks
- Deprecated hooks
- JavaScript reference
- Shortcodes reference
- FacetWP REST API
- How FacetWP works
- The FacetWP URL
- FacetWP speed and limits
- Tutorials
- Code snippets
- Feedback
- What’s new
- Changelog
- News & announcements
WordPress REST API Authentication
With the WordPress REST API Authentication plugin by miniOrange you can protect WP REST API endpoints from public access.
With the free version of this plugin, third-party APIs (like FacetWP’s) are excluded from adding authentication. However, with the default settings enabled, this plugin will unexpectedly block access to FacetWP’s /facetwp/v1/refresh
and /facetwp/v1/fetch
endpoints.
The /facetwp/v1/fetch
endpoint is already closed by default, to protect your data. (If you are building a custom application that needs access, you can enable it.) But the /facetwp/v1/refresh
endpoint should be open, because FacetWP uses it in the front-end for filtering. So this block will cause 403
or 401
errors on refresh (when filtering), leading to non-functioning facets.
Depending on what you intend to do, to fix this issue, you can upgrade to a suitable premium plan of this plugin, add authentication to the /facetwp/v1/refresh
endpoint, and add this fix to pass authentication data to the API request. Your facets will now only work for logged-in users (or better: on pages only visible for logged-in users).
Or you can disable protection for FacetWP’s /facetwp/v1/refresh
endpoint. To do so, open the “Protected REST APIs” settings, click open the “Un-Authenticated WordPress Custom REST APIs” tab, and scroll to /facetwp/v1
. Uncheck the /facetwp/v1/refresh
option. Leave the /facetwp/v1/fetch
option checked.
/facetwp/v1/refresh
endpoint, facet filtering will no longer work, also not for logged-in users. This is because by default, the WordPress REST API does not pass along authentication data. To fix this, you see this tutorial on how to pass authentication data through REST API requests.See also
- The FacetWP REST API
- How to pass authentication data through REST API requests
- Using FacetWP with the All-In-One Security (AIOS) plugin
Last updated: July 29, 2024