Typed core endpoints
Posts, pages, media, comments, users, categories, tags, themes, plugins, and more.
An async .NET client for WordPress’s REST API. Work with core resources through typed methods, or call plugin and custom routes directly.
WordPressSharp 2.x replaces the retired XML-RPC implementation with an asynchronous client for the WordPress REST API. It targets .NET 10 and needs no WordPress-specific dependency.
Posts, pages, media, comments, users, categories, tags, themes, plugins, and more.
Discover a site's API routes and call plugin or custom endpoints with JSON.
Network operations support async/await, cancellation tokens, and caller-managed HttpClient.
dotnet add package WordPressSharp --version 2.0.0
using WordPressSharp;
using var client = new WordPressClient(new WordPressClientOptions
{
SiteUri = new Uri("https://example.com/"),
Username = "api-user",
ApplicationPassword = Environment.GetEnvironmentVariable("WORDPRESS_APP_PASSWORD")!
});
var posts = await client.GetPostsAsync(new WordPressListOptions
{
PerPage = 10,
Status = "publish"
});
Application Password authentication is sent only over HTTPS to the configured site's host. Keep credentials in a secret store or environment variable.
See the README for endpoint examples, custom authentication, build instructions, and publishing details. WordPressSharp is maintained by Andy Brudtkuhl.