Sudip Chakraborty, P. S. Aithal

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

  • General Medicine

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.

Need a simple solution for managing your BibTeX entries? Explore CiteDrive!

  • Web-based, modern reference management
  • Collaborate and share with fellow researchers
  • Integration with Overleaf
  • Comprehensive BibTeX/BibLaTeX support
  • Save articles and websites directly from your browser
  • Search for new articles from a database of tens of millions of references
Try out CiteDrive

More from our Archive