Eliminating Author and Date Metadata from WooCommerce Product Search Results
For many e-commerce store owners running on WooCommerce, encountering unexpected author names and publication dates appearing alongside product listings can be a puzzling and frustrating experience. This metadata, often associated with blog posts, can inadvertently show up on product pages, category archives, or even within your site's internal search results. While seemingly a minor detail, its presence can detract from a professional store aesthetic and, in some cases, pose minor SEO or security considerations. Understanding why this happens and how to effectively remove it is crucial for maintaining a polished online storefront.
The Root Cause: WordPress Post Types and Theme Defaults
The primary reason for author names and dates appearing on WooCommerce product listings stems from the foundational architecture of WordPress itself. In WordPress, all content—be it a blog post, a page, or a WooCommerce product—is handled as a 'post type.' WooCommerce products, specifically, are a custom post type. Many WordPress themes are designed to display 'post meta' (like the author and publication date) on all post types by default, treating products similarly to blog entries.
This means that the issue is rarely a core WooCommerce bug. Instead, it's almost always a display characteristic inherited from your active WordPress theme. Themes often include settings to control the visibility of such metadata for blog posts, but these controls don't always extend intuitively to WooCommerce product listings, leading to the unexpected display.
Identifying Where the Metadata Appears
Before implementing a solution, it's important to differentiate where this metadata is appearing:
- On-Site Search Results/Product Archives: If the name and date are visible when customers use your website's internal search bar or browse product category pages, the issue is purely a theme display problem within your site's front end.
- External Search Engines (e.g., Google): If the metadata appears in Google search results snippets, this indicates a potential indexing issue, possibly related to structured data or how Google has cached your pages. While less common for product listings, it's a separate concern often addressed by SEO plugins.
For most store owners facing this problem, the metadata is appearing on their own site's search results or product display, making theme-level adjustments the most direct path to resolution.
Primary Solution: Adjusting Theme Settings
The most straightforward and recommended approach to remove author and date metadata is by adjusting your theme's settings. Most modern themes offer extensive customization options through the WordPress Customizer.
Step-by-Step Guide:
-
Access the Customizer: From your WordPress dashboard, navigate to
Appearance > Customize. -
Explore Theme Options: Look for sections related to 'Blog,' 'Posts,' 'Layout,' 'WooCommerce,' 'Product Catalog,' or 'Single Product.' Themes vary widely in their structure, so you might need to explore a few sections.
-
Locate Metadata Toggles: Within these sections, search for settings like 'Display Post Meta,' 'Show Author,' 'Show Date,' 'Product Meta,' or similar options. Many themes provide simple toggles or checkboxes to enable or disable these elements.
-
Apply and Publish: Once you find and disable the relevant settings, click 'Publish' to save your changes.
Some themes, especially premium ones, might have their own dedicated options panel outside of the Customizer. If you can't find the settings in the Customizer, check your theme's documentation or look for a separate 'Theme Options' menu item in your WordPress dashboard.
Quick Visual Fix: Custom CSS
If your theme lacks specific settings to control product metadata, or if the settings don't achieve the desired result, custom CSS offers a quick visual solution. This method hides the elements from view but does not remove them from the page's HTML structure.
How to Implement Custom CSS:
-
Navigate to Additional CSS: Go to
Appearance > Customize > Additional CSS. -
Add the Following Code: Paste the CSS snippet below into the provided text area.
.woocommerce ul.products li.product .posted_on, .author { display: none; } -
Publish Changes: Click 'Publish' to apply the CSS. The author name and date should now be hidden on your product listings and search results.
This CSS targets common classes used by WooCommerce and themes to display the date (.posted_on) and author (.author). You may need to inspect your site's elements using browser developer tools to identify specific classes if the provided snippet doesn't work universally, but it's a good starting point.
Advanced Control: Modifying Functions.php
For more robust solutions that remove the metadata from the HTML output entirely, or to address broader WordPress hygiene, direct code modifications via your theme's functions.php file are an option. However, this method requires caution:
-
Use a Child Theme: Directly editing your main theme's
functions.phpwill result in your changes being overwritten during theme updates. Always use a child theme for any custom code. - Snippet Plugins: Alternatively, use a code snippet plugin like FluentSnippets. These plugins allow you to add custom code without modifying theme files directly, ensuring your changes persist across updates and are easily manageable.
Example Snippets for Broader WordPress Hygiene:
While these snippets might not directly remove the author/date from your theme's product display (as that's often template-driven), they address related concerns that can inadvertently expose author information:
1. Remove Author Name and URL from oEmbed Response Data:
add_filter( 'oembed_response_data', function( $data ) {
unset( $data['author_name'], $data['author_url'] );
return $data;
} );
This prevents your author information from being included when your content is embedded on other sites.
2. Redirect Author Archive URLs to the Homepage:
add_action( 'template_redirect', function() {
if ( is_author() ) {
wp_safe_redirect( home_url() );
exit;
}
} );
This snippet enhances security by preventing direct access to author archive pages, which can sometimes be used for username enumeration, and also helps with SEO by avoiding duplicate content or thin pages.
Final Considerations
While the immediate goal is to clean up your product display, it's worth noting that managing metadata is part of a broader e-commerce strategy. For issues related to Google search results, ensure your SEO plugin (like Yoast SEO or Rank Math) is correctly configured to handle author archives and structured data. Tools like Google's Rich Results Test can help you verify how search engines interpret your product information.
Ultimately, the appearance of author names and dates on WooCommerce products is a common and solvable challenge. By systematically checking your theme settings, applying custom CSS, or utilizing advanced code snippets responsibly, you can ensure your product listings present a professional, streamlined experience for your customers.