WordPressSharp
A C# client to to interact with the WordPress XML-RPC API
Install / Use
/learn @abrudtkuhl/WordPressSharpREADME
WordPressSharp
A C# client to interact with the WordPress XML-RPC API
Install
I'm working on a Nuget package once I'm done mapping all the WP XML-RPC endpoints.
In the meantime, you'll have to clone, build, and add the DLL the ole fashioned way
Config
Use your config file to for configuration settings:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="WordPressUsername" value="" />
<add key="WordPressPassword" value="" />
<add key="WordPressBaseUrl" value="" />
<add key="WordPressBlogId" value="" />
</appSettings>
</configuration>
As an alternative you can use the WordPressSiteConfig class to store configuration settings.
Examples
Create Post
using (var client = new WordPressClient())
{
var post = new Post
{
PostType = "post",
Title = "My Awesome Post",
Content = "<p>This is the content</p>",
PublishDateTime = DateTime.Now
};
var id = Convert.ToInt32(client.NewPost(post));
}
Create Post Tag
using (var client = new WordPressClient())
{
var termId = client.NewTerm(new Term
{
Name = "term test",
Description = "term description",
Slug = "term_test",
Taxonomy = "post_tag"
});
}
Add feature image
You can add a feature image by using the Data.CreateFromUrl or Data.CreateFromFilePath:
string url = "https://unsplash.imgix.net/photo-1423683249427-8ca22bd873e0";
using (var client = new WordPressClient())
{
var post = new Post
{
PostType = "post",
Title = "New photo from Unsplash",
Content = "<p>Check out this new picture from Unsplash.</p>",
PublishDateTime = DateTime.Now
};
var featureImage = Data.CreateFromUrl(url);
post.FeaturedImageId = client.UploadFile(featureImage).Id;
var id = Convert.ToInt32(client.NewPost(post));
}
Tutorials
Dependencies
Resources
Notes
Inspired by the POSSIBLE.WordPress.XmlRpcClient by markeverard
Related Skills
node-connect
353.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
