WooCommerce

Clean Up Your WooCommerce Store: Hiding Author and Date from Product Listings

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, confuse customers, 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, user-friendly online storefront.

WordPress Customizer 'Additional CSS' section for adding custom styling to hide WooCommerce product author and date.
WordPress Customizer 'Additional CSS' section for adding custom styling to hide WooCommerce product author and date.

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 static 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. This default behavior, while logical for a blog-centric site, can be counterproductive for an e-commerce store where the focus should be squarely on the product itself, not who posted it or when.

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, browse product category pages, or view individual product detail pages, the issue is purely a theme display problem within your site's front end. This is the most common scenario and typically the easiest to resolve.
  • External Search Engine Results (e.g., Google): If the metadata appears in Google search snippets, it could be due to Google pulling visible text from your page, or it might be embedded in your site's structured data (schema markup). While the focus of this guide is primarily on-site display, it's worth noting that addressing the on-site visibility often resolves external search engine issues over time as Google re-crawls your site. SEO plugins like Yoast SEO or Rank Math offer specific settings to control what metadata is indexed or included in schema.

Practical Solutions to Remove Unwanted Product Metadata

Fortunately, there are several effective methods to remove author names and dates from your WooCommerce product listings, ranging from simple theme settings to more advanced code snippets.

1. Check Your Theme Customizer and Settings

This is always the first and easiest place to look. Many modern WordPress themes, especially those designed with WooCommerce integration in mind, offer direct controls for displaying post meta. Navigate to Appearance > Customize in your WordPress dashboard. From there, look for sections related to:

  • WooCommerce: Often has sub-sections for "Product Catalog," "Single Product," or "Shop Page."
  • Blog/Posts: Sometimes these settings inadvertently apply to custom post types like products.
  • General Layout/Typography: Some themes group meta display options here.

Look for toggles or checkboxes labeled "Display Author," "Show Date," "Post Meta," or similar. Disabling these for product-related sections can often resolve the issue immediately. Theme developers sometimes include these options specifically because this is a common request.

2. Apply Custom CSS for a Quick Hide

If your theme doesn't offer a direct setting, custom CSS is a straightforward way to visually hide the metadata. This method doesn't remove the data from the page's HTML, but it makes it invisible to your visitors. You can add custom CSS by going to Appearance > Customize > Additional CSS.

Use the following CSS snippet:

.woocommerce ul.products li.product .posted_on,
.woocommerce ul.products li.product .author,
.single-product .posted_on,
.single-product .author {
    display: none !important;
}

This code specifically targets the elements that display the date (.posted_on) and author (.author) within WooCommerce product listings and single product pages, setting their display property to none. The !important tag ensures that your custom CSS overrides any conflicting styles from your theme.

3. Utilize `functions.php` or a Snippet Plugin (Advanced)

For a more robust solution that removes the metadata from the page's output entirely, or to address potential security concerns like username enumeration (where an attacker can guess usernames from author archive URLs), you can use PHP code. This is typically done via your theme's functions.php file or, preferably, a dedicated code snippet plugin.

Important: Directly editing your theme's functions.php file is risky. Mistakes can break your site, and your changes will be overwritten when the theme updates. Always use a child theme or a code snippet plugin for custom PHP.

Popular and free snippet plugins like FluentSnippets or Code Snippets allow you to add custom PHP without modifying core theme files. Here are two useful snippets:

Remove Author Name and URL from oEmbed Data:

This snippet prevents your author name and URL from being included when your content is embedded on other sites (oEmbed).

/**
 * 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;
} );

Redirect Author Archive URLs:

This snippet redirects any attempts to access author archive pages (e.g., yourstore.com/author/yourname/) back to your homepage, preventing username enumeration and ensuring a cleaner site structure.

/**
 * Redirect author archive URLs to the homepage to prevent username enumeration.
 */
add_action( 'template_redirect', function() {
    if ( is_author() ) {
        wp_safe_redirect( home_url() );
        exit;
    }
} );

While these PHP snippets are more geared towards backend data and security, they contribute to a comprehensive approach to managing author metadata on your site.

4. Configure SEO Plugins

If you're using an SEO plugin like Yoast SEO or Rank Math, these tools often provide settings to control the indexing of author archives. Even if the visual issue is on-site, it's good practice to ensure these archives are set to 'noindex' or disabled if they're not contributing to your SEO strategy. This prevents search engines from potentially associating your personal name with product listings in their results.

Post-Implementation Steps

After applying any of these solutions, it's crucial to:

  • Clear Your Cache: If you use a caching plugin (e.g., WP Super Cache, LiteSpeed Cache, WP Rocket) or your host provides server-side caching, clear it immediately. Old cached versions of your pages might still display the metadata.
  • Check Multiple Pages: Verify that the author name and date are removed from various product pages, category archives, and internal search results.
  • Test Responsiveness: Ensure the changes look correct on different devices (desktop, tablet, mobile).

Conclusion

A clean, professional appearance is paramount for any successful e-commerce store. Unwanted author names and dates on your WooCommerce product listings, while a common issue stemming from WordPress's flexible architecture and theme defaults, are easily fixable. By systematically checking your theme settings, applying custom CSS, or utilizing more advanced PHP snippets, you can ensure your products take center stage, providing a seamless and professional shopping experience for your customers. Remember, a well-maintained storefront builds trust and encourages conversions.

Share: