Skip to content
Menu
TechFacts007.in
  • Information Zone
  • Reviews
    • Apps Reviews
    • PC’s
  • Gadgets
  • Hosting
    • Domain and Hosting
      • cPanel
    • WordPress
  • More
    • Tech Facts
    • Tips & Tricks
TechFacts007.in
wordpress logo
September 26, 2020

What is WP-JSON in WordPress – REST API of WordPress

WP-JSON in WordPress

Definition of WP and JSON: WP stands for WordPress and JSON is for JavaScript Object Notation. JSON is highly used in the REST API. All data will be formatted in JSON format so that the developer can easily fetch the data from the API.

What is WP-JSON:

WordPress already provides many tools and interfaces for building sites. You should not feel any pressure to use the REST API. Rest API is not for building themes or plugins of WordPress.

If you are creating your own client-side application then you need to fetch the data from your WordPress database. It’s not compulsory to create your app in only PHP language. You can choose any language to create your application. The data from your WordPress will be provided in JSON format. You can choose any programming language which can make HTTP request and interpret JSON can use the API. The REST API is used to interact with WordPress. Some languages are PHP, Java, Swift, Kotlin, Node.js, etc…

Vanilla JavaScript and jQuery can also fetch data through the API.

 


What is REST API:

An API is an interface that helps to fetch some data from the server and it also can update our database using API.

REST API: REST API is less robust than the alternatives. It is relatively simple and flexible. REST API deals with these 4 HTTP requests.

  • GET
  • PUT
  • POST
  • DELETE

 


Fetch Basic Data: To fetch some basic information from WP-JSON you just do a get request.

If you want to get information on your webpage then please use JSON Viewer Extension on your chrome browser. This extension helps to structure the data into JSON format.

 

json viewer

The URL for accessing different types of data through WP-JSON are:

// Access the complete resource of wp-json
<domain_name>/<wp_installation_dir>/wp-json/

// Get the list off all registered users
<domain_name>/<wp_installation_dir>/wp-json/wp/v2/users/

// Get the details of any specific user
<domain_name>/<wp_installation_dir>/wp-json/wp/v2/users/<userid>

// Get the list of all published posts
<domain_name>/<wp_installation_dir>/wp-json/wp/v2/posts

// Get data about any specific post
<domain_name>/<wp_installation_dir>/wp-json/wp/v2/posts/<post_id>

// Get List of all published pages
<domain_name>/<wp_installation_dir>/wp-json/wp/v2/pages

<wp_installation_dir> means the directory where the WordPress is installed. If you installed WordPress on your root directory then URL will be <domain_name>/wp-json/

There are so many tools in the WordPress plugin page that can disable the WP-JSON functionality from your WordPress site. If you don’t want to use it then it’s good to disable this.

 


WP-JSON functionality can be extended by different types of plugins. Like if you are using the WooCommerce plugin then many more things are available through the API. Disabling WP-JSON is not good for your site because many plugins use this feature to access the site information.

 

I hope I cleared your all doubts on WP-JSON. If you still have any doubt then please comment below.

Post Views: 1,073

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Trending

  • Tech Facts
    52.376552,5.198303(Dead Body Found) Google Map
  • Information Zone , Programming Languages , Tutorials
    React Hook To Check If User Has Changed/Minimize the Browser Tab
  • Codes , Programming Languages
    Find out if you can reach the last tile – Program Code
  • How to , Information Zone , Tips & Tricks
    Download any paid Software. Get any software free for lifetime
  • PC's , Tips & Tricks
    Mount and Unmount Virtual Hard Disk (CMD Command and batch File Method)
  • How to , Information Zone , Tips & Tricks
    Encrypt Javascript and CSS Code – Hide Original Code from Users
  • Information Zone , PC's
    How To Create Wi-Fi Hotspot Network With PC Using CMD
  • Information Zone
    USB 2.0 vs USB 3.0 (Universal Serial BUS)

Recent Posts

  • Create Sitemap for React.Js Web App – Sitemap.xml for react app May 27, 2023
  • The Importance of Sitemap.xml: Enhancing Website Visibility and SEO May 27, 2023
  • Web Page Generation – Difference between SSR, CSR and SSG May 26, 2023
  • React.js vs. Next.js – Choosing the Right Framework for Your Web Development Needs May 26, 2023
  • NGINX vs. Apache: Exploring the Differences and Choosing the Right Web Server May 21, 2023
  • Setting Up NGINX on Ubuntu Server and Activating a Domain on NGINX Server May 21, 2023
  • Functional Component vs Class Component in React.Js January 18, 2023
  • React.Js Lifecycle Methods January 18, 2023
  • What is componentDidMount and useEffect with Example January 18, 2023
  • React Hook To Check If User Has Changed/Minimize the Browser Tab August 17, 2022

Categories

  • Apps Reviews (4)
  • Gadgets (4)
  • Hack With Us (2)
  • Hosting (12)
    • Domain and Hosting (7)
      • cPanel (5)
    • Wordpress (5)
  • How to (11)
  • Information Zone (64)
  • PC's (7)
  • Product Reviews (11)
  • Programming Languages (10)
    • Codes (5)
    • Tutorials (5)
  • Smart Phones (8)
  • Tech Facts (13)
  • Tips & Tricks (13)

Browse By Date

June 2023
M T W T F S S
 1234
567891011
12131415161718
19202122232425
2627282930  
« May    

More

Contact Us
Privacy Policy
About Us
About Admin

Advertisement

Other Sites

ShanuTheWebDev.in
GaanaWorld.in
QrCode.ShanuTheWebDev.in
©2023 TechFacts007.in | Powered by WordPress and Superb Themes!