wp_update_site_settings
Modify WordPress site settings including title, description, and timezone through the MCP WordPress Server to customize site configuration.
Instructions
Updates one or more general settings for a WordPress site.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | The ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured. | |
| title | No | The title of the site. | |
| description | No | The tagline or description of the site. | |
| timezone | No | A city in the same timezone, e.g., 'America/New_York'. |
Implementation Reference
- src/tools/site.ts:194-201 (handler)The MCP tool handler function that receives parameters, calls WordPressClient.updateSiteSettings, and returns a formatted success message or throws an error.public async handleUpdateSiteSettings(client: WordPressClient, params: Record<string, unknown>): Promise<unknown> { try { const updatedSettings = await client.updateSiteSettings(params); return `✅ Site settings updated successfully. New title: ${updatedSettings.title}`; } catch (_error) { throw new Error(`Failed to update site settings: ${getErrorMessage(_error)}`); } }
- src/tools/site.ts:34-55 (registration)Tool registration object within SiteTools.getTools() array, defining name, description, input parameters schema, and handler binding.{ name: "wp_update_site_settings", description: "Updates one or more general settings for a WordPress site.", parameters: [ { name: "title", type: "string", description: "The title of the site.", }, { name: "description", type: "string", description: "The tagline or description of the site.", }, { name: "timezone", type: "string", description: "A city in the same timezone, e.g., 'America/New_York'.", }, ], handler: this.handleUpdateSiteSettings.bind(this), },
- src/server/ToolRegistry.ts:47-62 (registration)Dynamic registration of all tool classes (including SiteTools) by instantiating them, calling getTools(), and registering each tool with the MCP server.Object.values(Tools).forEach((ToolClass) => { let toolInstance: { getTools(): unknown[] }; // Cache and Performance tools need the clients map if (ToolClass.name === "CacheTools" || ToolClass.name === "PerformanceTools") { toolInstance = new ToolClass(this.wordpressClients); } else { toolInstance = new (ToolClass as new () => { getTools(): unknown[] })(); } const tools = toolInstance.getTools(); tools.forEach((tool: unknown) => { this.registerTool(tool as ToolDefinition); }); });
- src/types/tools.ts:481-497 (schema)TypeScript interface defining the structured input parameters for the wp_update_site_settings tool.export interface UpdateSiteSettingsParams extends BaseToolParams { readonly title?: string; readonly description?: string; readonly url?: string; readonly email?: string; readonly timezone?: string; readonly date_format?: string; readonly time_format?: string; readonly start_of_week?: number; readonly language?: string; readonly use_smilies?: boolean; readonly default_category?: CategoryId; readonly default_post_format?: string; readonly posts_per_page?: number; readonly default_ping_status?: PingStatus; readonly default_comment_status?: CommentStatus; }
- src/client/operations/site.ts:39-41 (helper)Core helper function in SiteOperations that performs the actual POST request to the WordPress REST API /settings endpoint to update site settings.async updateSiteSettings(settings: Partial<WordPressSiteSettings>): Promise<WordPressSiteSettings> { return this.client.post<WordPressSiteSettings>("settings", settings); }