I'm developing a plugin for Wordpress and I need to use WordPress REST api but they do not work. I have just tried the basic ones but the site returns the homepage.
Any idea about that?
I had this problem too, but the most common cause is that permalinks are not set.
I tried looking for this in the documentation but it is somewhat hidden in the handbook under Discovery
For sites without “pretty permalinks” enabled, /wp-json/ isn’t automatically handled by WordPress. This means that normal/default WordPress permalinks will be used instead. These headers look more like this:
Link: http://example.com/?rest_route=/; rel="https://api.w.org/"
Thank you 👍
Most helpful comment
I had this problem too, but the most common cause is that permalinks are not set.
I tried looking for this in the documentation but it is somewhat hidden in the handbook under Discovery