wordpress
/wordpress
Expert WordPress assistance covering themes, plugins, REST API, Gutenberg blocks, and WP_Query. Use when developing custom WordPress plugins, themes, or headless CMS backends.
- Author
- G1Joshi ↗
- Repository
- Agent-Skills ↗
- Licence
- MIT
- Last repository change
- 01.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 2
No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Expert WordPress assistance covering themes, plugins, REST API, Gutenberg blocks, and WP_Query. Use when developing custom WordPress plugins, themes, or headless CMS backends.
Original author description
Expert WordPress assistance covering themes, plugins, REST API, Gutenberg blocks, and WP_Query. Use when developing custom WordPress plugins, themes, or headless CMS backends.
How it works
- When to Use
- Quick Start
- Core Concepts
- Common Patterns
- Best Practices
- Troubleshooting
- References
SKILL.md preview
---
name: wordpress
description: Expert WordPress assistance covering themes, plugins, REST API, Gutenberg blocks, and WP_Query. Use when developing custom WordPress plugins, themes, or headless CMS backends.
---
# WordPress
WordPress is an extensible open-source content management system featuring Full Site Editing (FSE), block-based theming, and headless REST/GraphQL architectures.
## When to Use
- **Modern Content Management Platforms**: Powering blogs, news publications, and enterprise corporate websites.
- **Gutenberg Custom Block Development**: Developing custom editorial blocks using `@wordpress/scripts` and React.
- **Headless WordPress**: Using WordPress as a content backend decoupled from Next.js, Nuxt, or Astro frontends.
- **Modern PHP 8.2+ Plugins & Themes**: Writing object-oriented, PSR-compliant WordPress code.
## Quick Start
```php
<?php
/**
* Plugin Name: Custom API Endpoint
* Description: Registers a custom WordPress REST API endpoint.
* Version: 1.0.0
*/
add_action('rest_api_init', function () {
register_rest_route('custom/v1', '/latest-posts', [
'methods' => 'GET',
'callback' => function () {
$posts = get_posts(['numberposts' => 5]);
return new WP_REST_Response($posts, 200);
},
'permission_callback' => '__return_true'
]);
});
```
## Core Concepts
### Gutenberg Custom Block with @wordpress/scripts
Building editorial blocks using React and block.json metadata:
```json
// block.json
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "custom/hero-banner",
"version": "1.0.0",
"title": "Hero Banner",
"category": "design",
"icon": "superhero",
"attributes": {
"heading": { "type": "string", "default": "Default Hero" }
},
"editorScript": "file:./index.js",
"render": "file:./render.php"
}
```
```javascript
// src/index.js
import { registerBlockType } from "@wordpress/blocks";
import { RichText, useBlockProps } from "@wordpress/block-editor";
registerBlockType("custom/hero-banner", {
edit: ({ attributes, setAttributes }) => {
const blockProps = useBlockProps({ className: "custom-hero-editor" });
return (
<div {...blockProps}>
<RichText
tagName="h1"
value={attributes.heading}
onChange={(val) => setAttributes({ heading: val })}
placeholder="Enter hero title..."
/>
</div>
);
},
save: () => null, // Dynamic rendering handled by render.php
});
```
### Type-Safe WP REST API Endpoint Registration
Exposing custom REST endpoints with permission callbacks:
```php
namespace App\Rest;
add_action('rest_api_init', function () {
register_rest_route('app/v1', '/metrics', [
'methods' => 'GET',
'callback' => function (\WP_REST_Request $request) {
return new \WP_REST_Response([
'posts_count' => wp_count_posts()->publish,
'status' => 'healthy',
'timestamp' => time(),
], 200);
},
'permission_callback' => function () {
return current_user_can('edit_posts');
},
]);
});
```
### Secure Database Queries with $wpdb
Preventing SQL injection using prepared statements:
```php
function get_verified_order(int $order_id): ?object {
global $wpdb;
$table_name = $wpdb->prefix . 'custom_orders';
$query = $wpdb->prepare(
"SELECT id, total_amount, customer_email FROM {$table_name} WHERE id = %d AND status = %s",
$order_id,
'completed'
);
return $wpdb->get_row($query);
}
```
## Common Patterns
### Efficient WP_Query with Custom Meta and Pagination
**Problem**: Complex meta queries cause high server load and unindexed table scans on `wp_postmeta`.
**Solution**:
Use indexed fields and limit fields returned:
```php
$args = [
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => 12,
'paged' => get_query_var('paged') ? get_query_var('paged') : 1,
'meta_query' => [
[
'key' => 'in_stock',
'value' => '1',
'compare' => '='
]
],
'no_found_rows' => false, // Set true if pagination is not needed
];
$query = new WP_Query($args);
```
## Best Practices
**Do**:
- Target WordPress 6.x+ with Block API v3 and Full Site Editing (FSE) block themes.
- Always use `permission_callback` in `register_rest_route()` to prevent unauthorized API access.
- Use `$wpdb->prepare()` for all custom SQL statements to eliminate SQL injection vulnerabilities.
- Sanitize incoming inputs (`sanitize_text_field()`) and escape outgoing outputs (`esc_html()`, `esc_url()`).
**Don't**:
- Write raw SQL queries when native `WP_Query` or `get_posts()` can fulfill the requirement.
- Build classic PHP widget-based themes for new projects; adopt Block Themes and Gutenberg.
- Commit secrets, database credentials, or security salts to version control.
## Troubleshooting
| Error | Cause | Solution |
| :----------------------------- | :----------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `Headers already sent error` | Whitespace or output before `<?php` tag or inside `functions.php`. | Check for empty lines before opening `<?php` or remove trailing `?>`. |
| `REST API 403 Forbidden` | Nonce verification failed or `permission_callback` missing. | Provide valid `X-WP-Nonce` header or define appropriate permission callback. |
| `White Screen of Death (WSOD)` | Fatal PHP error with `WP_DEBUG` disabled. | Enable `define('WP_DEBUG', true);` in `wp-config.php` to inspect stack trace. |
## References
- [WordPress Developer](https://developer.wordpress.org/)
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · G1Joshi/Agent-Skills | 100 | MIT |
| ericrisco/rsc-harness | 100 | MIT |
| AceDataCloud/Skills | 100 | Apache-2.0 |
| TerminalSkills/skills | 100 | Apache-2.0 |
| xclouddev/xcloud-agent-skills | 100 | MIT |
| pingqLIN/skill-0 | 100 | MIT |
| ar4mirez/samuel | 100 | MIT |
| frontman-ai/frontman | 81 | Apache-2.0 |
Database snapshot: 13.11.2026 · package version 7f45b7556d82 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100wordpress-pro
Develops custom WordPress themes and plugins, creates and registers Gutenberg blocks and block patterns, configures WooCommerce stores, implements WordPress REST API endpoints, applies security hardening (nonces, sanitization, escaping, capability checks), and optimizes… - 95wordpress-developer
Use when developing WordPress themes, plugins, or blocks — theme.json configuration, block themes, classic themes, child themes, plugin architecture, custom post types, taxonomies, Gutenberg block development, WordPress REST API custom endpoints, WP-CLI commands, hooks/filters… - 100wordpress-pro
Develops custom WordPress themes and plugins, creates and registers Gutenberg blocks and block patterns, configures WooCommerce stores, implements WordPress REST API endpoints, applies security hardening (nonces, sanitization, escaping, capability checks), and optimizes… - 90wordpress-wordpress-router
Use when the user asks about WordPress codebases (plugins, themes, block themes, Gutenberg blocks, WP core checkouts) and you need to quickly classify the repo and route to the correct workflow/skill (blocks, theme.json, REST API, WP-CLI, performance, security, testing, release packaging). - 90wordpress-router
Use when the user asks about WordPress codebases (plugins, themes, block themes, Gutenberg blocks, WP core checkouts) and you need to quickly classify the repo and route to the correct workflow/skill (blocks, theme.json, REST API, WP-CLI, performance, security, testing, release packaging). - 100strapi
Expert Strapi headless CMS assistance covering content types, plugins, REST/GraphQL APIs, and custom controllers. Use when building self-hosted, customizable Node.js headless CMS backends.