Facebookをやめるのでマストドンふっか~つ!

Make.com でWordpressのJSON URLが必要なので、それはどこなのかを知らねばならないのでChatGPTにきいてみた

To find your WordPress site’s API URL, you need to know whether your site is hosted on WordPress.com or is a self-hosted WordPress site. Here’s how to find the API URL for both scenarios:


1. WordPress.com Site ← 今回はこっちね

If your site is hosted on WordPress.com:

  • The API URL is typically in the format:bashコードをコピーするhttps://public-api.wordpress.com/wp/v2/sites/your-site.wordpress.com
  • Replace your-site.wordpress.com with your actual WordPress.com site URL.
    今回は https://hogehoge.com//wp-json/ だった

Steps to Confirm:

  1. Log in to your WordPress.com account.
  2. Go to your site’s dashboard.
  3. Use the above format to confirm the URL works. For example:
    • Visit https://public-api.wordpress.com/wp/v2/sites/your-site.wordpress.com/posts in your browser to view a JSON feed of your posts.

2. Self-Hosted WordPress Site

If you’re using a self-hosted WordPress site (installed on your own server or through a hosting provider like Bluehost, SiteGround, etc.):

  • The API URL is typically in the format:arduinoコードをコピーするhttps://your-domain.com/wp-json/wp/v2
  • Replace your-domain.com with your actual site URL.

Steps to Confirm:

  1. Ensure the WordPress REST API is enabled (it is enabled by default on WordPress 4.7+).
  2. Visit:arduinoコードをコピーするhttps://your-domain.com/wp-json This should display the REST API root.

Example Endpoints:

  • Posts: https://your-domain.com/wp-json/wp/v2/posts
  • Pages: https://your-domain.com/wp-json/wp/v2/pages

3. How to Verify API Functionality

  1. Open a browser or API tool (e.g., Postman).
  2. Enter the URL (e.g., https://your-domain.com/wp-json or the WordPress.com API URL).
  3. You should see JSON data that confirms the REST API is working.

Troubleshooting:

  • Error 404: Ensure your site uses pretty permalinks (Settings > Permalinks > Set to anything but "Plain").
  • Blocked API: Some hosting providers may block the REST API. Check your hosting settings or contact support.
  • WordPress.com Plan Limitation: Free WordPress.com plans may have restricted API access for third-party tools.

また日を改めて試してみるか