Inspecting Custom Post Type Metadata
Introduction
Custom Post Types (CPTs) are a powerful WordPress feature that allows you to create different content types beyond the standard posts and pages. PureDevs Any Meta Inspector automatically works with all custom post types in your WordPress installation, displaying their metadata in the same convenient way.
Whether you’re using CPTs for portfolios, products, testimonials, or any custom content type created by plugins or themes, the inspector makes it easy to view and debug their metadata.
Understanding Custom Post Types
Custom Post Types extend WordPress beyond blog posts and pages. Common examples include:
- WooCommerce: Products, Orders, Coupons
- Portfolio Plugins: Portfolio items, Projects
- Event Plugins: Events, Venues, Organizers
- Real Estate: Properties, Listings
- Testimonials: Client testimonials, Reviews
- Custom Solutions: Any content type you or developers have created
PureDevs Any Meta Inspector automatically detects all registered custom post types and adds the metadata metabox to their edit screens. No configuration is required.
Accessing Custom Post Type Metadata
To inspect metadata for any custom post type:
- Navigate to your custom post type in the WordPress admin menu (e.g., Products, Portfolio, Events)
- Click on any item to edit it
- Scroll down on the edit screen
- Find the metadata metabox (usually labeled with the post type name + “Metadata”)
- All meta keys and unserialized values will be displayed
Example: WooCommerce Products
If you have WooCommerce installed:
- Go to Products → All Products
- Edit any product
- Look for the metadata metabox
- You’ll see product-specific metadata like pricing, SKU, stock status, and more
Common Custom Post Type Metadata
Different custom post types store different types of metadata. Here are some examples:
WooCommerce Products
_price– Product price_regular_price– Regular price before discounts_sale_price– Sale price if on sale_sku– Stock Keeping Unit_stock– Current stock quantity_stock_status– In stock, out of stock status_product_attributes– Product attributes (serialized array)
Event Management Plugins
- Event start and end dates
- Venue information
- Ticket pricing and availability
- Organizer details
- RSVP settings
Portfolio/Project CPTs
- Client name
- Project completion date
- Project URL
- Gallery images (array of attachment IDs)
- Technologies used
Real Estate Listings
- Property price
- Square footage
- Number of bedrooms/bathrooms
- Property address and coordinates
- MLS listing number
Practical Use Cases
1. Debugging Plugin Functionality
When a plugin’s custom post type isn’t working as expected:
- Verify the plugin is saving metadata correctly
- Check if metadata keys match what the plugin documentation specifies
- Identify missing or incorrect data
- See exactly how complex data structures are being stored
2. Custom Development
When developing custom functionality for CPTs:
- Test that your custom meta boxes are saving data correctly
- Verify the data format matches your frontend code expectations
- Debug serialization and array structures
- Understand how third-party plugins store their data
3. Data Migration
When migrating between plugins or themes:
- Identify all metadata fields that need to be migrated
- Understand the data structure for mapping to new fields
- Verify data integrity after migration
- Plan data transformation strategies
4. Performance Optimization
Identify performance issues by:
- Finding excessive or redundant metadata
- Identifying large serialized arrays that could be optimized
- Spotting metadata that could be moved to taxonomies
Working with Complex Metadata
Serialized Arrays
Many plugins store complex data as serialized arrays. PureDevs Any Meta Inspector automatically unserializes these for easy viewing:
- Product variations and attributes
- Repeater field data from custom field plugins
- Gallery image collections
- Multi-select option values
Nested Data Structures
The inspector handles nested arrays and objects, displaying them in a readable hierarchy so you can understand complex data relationships.
When working with WooCommerce or other e-commerce plugins, inspecting product metadata is invaluable for debugging pricing issues, inventory problems, or attribute display errors.
Tips for Custom Post Types
Multiple Custom Post Types
If you have many custom post types, the inspector works independently on each:
- Each CPT gets its own metadata metabox
- Metadata is specific to each post type
- No cross-contamination between different CPTs
Plugin-Generated vs. Custom Metadata
Differentiate between metadata sources:
- Plugin metadata often uses prefixed keys (e.g.,
_wc_for WooCommerce) - Custom fields usually have descriptive names
- System metadata starts with underscore (
_)
Hidden Metadata
WordPress hides some metadata by default (fields starting with underscore). PureDevs Any Meta Inspector shows all metadata, including hidden fields, giving you complete visibility.
Always exercise caution when working with metadata. The inspector is read-only, but if you manually edit database values based on what you see, ensure you understand the data structure to avoid breaking functionality.
Troubleshooting
Metabox not appearing on custom post type
- Check if the custom post type is publicly accessible
- Verify the CPT is registered correctly
- Check Screen Options to enable the metabox
- Try deactivating and reactivating the plugin
Some custom post types show metadata, others don’t
- This is normal – not all posts have metadata
- CPTs with no custom fields will show empty or minimal metadata
- Try viewing different items of that post type
Metadata appears garbled or incomplete
- The data may be corrupted in the database
- Check the source plugin or theme for issues
- The inspector displays exactly what’s in the database
Was this article helpful?
Help us improve our documentation by providing feedback