CRUD Operation On WordPress Custom Post Type (CPT) From C# Over REST API

Main Article Content

Sudip Chakraborty
Aithal P. S.

Abstract

Purpose: WordPress is a popular content management system. Around 45% of the internet's websites are powered by WordPress. Its main feature is posts. The contents are stored as posts. WordPress uses a database to store posts and configurations. Its REST API interface is robust and feature-rich. We can efficiently save the data from external environments into the database over the REST API as a post. However, standard post types provide enormous amounts of data. Low-speed systems and real-time processing can create a bottleneck. The data flow can be optimized using custom post type (CPT). Here, we describe how to create a custom field using available plugins. We make a REST API client using C# language. From the client application, we execute CRUD operation. The complete project code is freely available on GitHub.


Design/Methodology/Approach: There are several ways to test WordPress code. Instead of testing in live WordPress website, the best way is to work in local website. It is not harmful anymore because code is deploying in local only. to install WordPress locally, we use the “LOCAL” application. Using this approach, we can eliminate the server hiring cost for the experiment. after that inside the local application, we install WordPress Website. Then create Custom route to navigate our code. For client side, we make a client application in C# with GUI for better operation.


Findings/Result: We ran the project for a long time with practical examples without any issues. This architecture can be used to store IoT data inside the cloud. For the POST data is stored in the “wp_Posts” table where the additional CPT field is kept inside the “wp_postmeta” table, a couple of extra transactions that might cause data flow delays.


Originality/Value: WordPress database generally stores external data using post type. Here, we are using an approach beyond general usage. Even C# is not used for this purpose. The other more high-level languages are available to do our task effectively. However, the researchers from the dot net framework domain who want to keep data in the WordPress database as a custom post type can get this as a practical reference.


Paper Type: Experimental-based Research.

Article Details

How to Cite
Sudip Chakraborty, & Aithal P. S. (2023). CRUD Operation On WordPress Custom Post Type (CPT) From C# Over REST API. International Journal of Case Studies in Business, IT and Education (IJCSBE), 7(4), 323–331. https://doi.org/10.47992/IJCSBE.2581.6942.0322
Section
Articles

Most read articles by the same author(s)

1 2 3 4 5 6 7 8 > >>