Ora

How do I remove the date from Google search results in WordPress?

Published in WordPress SEO 4 mins read

To remove the date from Google search results for your WordPress content, you need to modify how the date is displayed on your website and how it's communicated to search engines. Google typically extracts this information directly from your page's visible content or through structured data.

Understanding Why Dates Appear

Dates usually appear in Google search results because your WordPress theme or a plugin is displaying the publication or last updated date on your posts and pages. Google's algorithms detect this information, often through explicit schema markup (like datePublished or dateModified), or by identifying common date formats within your content.

Methods to Remove Dates from Your WordPress Site

The most effective way to prevent dates from appearing in Google search results is to stop displaying them on your WordPress site entirely. Here are several methods to achieve this:

1. Theme and Plugin Settings (Easiest First Step)

Many modern WordPress themes and some content-related plugins offer built-in options to control the display of post dates. This is the simplest and recommended first approach.

  • Check Theme Customizer: Navigate to Appearance > Customize in your WordPress dashboard. Look for sections related to "Blog," "Single Post," "Post Meta," or "Layout." You might find toggles or checkboxes to hide post dates, author information, or other meta details.
  • Review Theme Options Panel: Some themes have a dedicated options panel (e.g., in Appearance or a top-level menu item). Explore these settings for date display options.
  • Inspect Plugin Settings: If you're using a page builder, a custom post type plugin, or a blog layout plugin, check its settings. It might be responsible for injecting dates.

If you cannot find an option to remove the dates within your theme or plugin settings, consider contacting the theme or plugin developer for support. They may be able to guide you to a hidden setting or provide a custom code snippet.

2. Using CSS to Hide Dates (Visual Only)

You can hide dates visually using CSS. While this removes the date from a user's view, Google's crawlers might still be able to detect the date in the underlying HTML, although they are less likely to display it in search results if it's hidden from the user. This method is a quick fix but not the most robust for SEO.

  • Identify the CSS Class/ID:
    1. Right-click on a date on your post/page and select "Inspect" (or "Inspect Element").
    2. Look for the HTML element containing the date (e.g., <span class="entry-date">, <time class="published">). Note down its class or ID.
  • Add Custom CSS:
    1. Go to Appearance > Customize > Additional CSS.
    2. Add CSS rules like:
      .entry-date {
          display: none !important;
      }
      /* Or if it's an ID */
      #post-date {
          display: none !important;
      }
    3. Replace .entry-date or #post-date with the actual class or ID you found.
    4. Click "Publish."

3. Removing Dates via Child Theme (PHP Modification)

This is the most thorough method as it completely removes the date output from your website's HTML. Always use a child theme for this. Modifying core theme files directly will result in your changes being lost during theme updates.

  • Create a Child Theme: If you don't have one, create a child theme for your current theme.

  • Identify Relevant Template Files:

    1. Connect to your site via FTP or your hosting's file manager.
    2. Navigate to /wp-content/themes/your-parent-theme-name/.
    3. Common files that display post meta include single.php, content.php, index.php, archive.php, or files within a template-parts directory (e.g., template-parts/content-single.php).
  • Locate and Remove Date Functions:

    1. Copy the identified template file(s) to your child theme's directory.

    2. Open the file in a code editor.

    3. Look for WordPress functions related to date display, such as:

      • the_date()
      • the_time()
      • get_the_date()
      • get_the_time()
      • posted_on() (common in twentytwentyone themes)
      • Functions often wrapped in <time> HTML tags.
    4. Carefully remove or comment out the lines of code that call these functions or wrap them. For example:

      // Before:
      <time class="entry-date published" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time>
      
      // After (removed):
      // (Nothing here, or you can comment it out for future reference)
    5. Save the modified file in your child theme.

4. Using SEO Plugins to Control Schema Markup

SEO plugins like Yoast SEO or Rank Math allow you to control the schema markup on your pages. Even if you hide the date visually, the schema markup might still be telling Google about a publication date.

  • Yoast SEO:
    1. Go to YoSEO > Search Appearance > Content Types.
    2. For "Posts" and "Pages," look for options related to "Date in Snippet Preview" or "Schema Settings." You might be able to disable date output in schema.
    3. Under Schema settings for individual posts/pages (in the Yoast SEO meta box), ensure that the "Article Type" is set appropriately (e.g., to WebPage if it's truly evergreen content with no relevant date, though Article often requires a date).
  • Rank Math:
    1. Go to Rank Math > Titles & Meta > Posts (or Pages).
    2. Look for options to disable dateModified or datePublished from schema, or settings related to "Schema Markup."
    3. In the Rank Math meta box on individual posts, check the "Schema" tab and configure the "Article" or "WebPage" schema settings to avoid including date fields if possible.

By explicitly telling Google not to include date information in your structured data, you can further influence its behavior in search results.

Summary of Methods

Method Description Pros Cons
Theme/Plugin Settings Check built-in options to hide dates. Easiest, no code required. Not always available; relies on theme/plugin developer.
CSS (Additional CSS) Hide dates visually using display: none;. Quick, no file editing. Dates still present in HTML; less robust for SEO; Google might still infer.
Child Theme (PHP) Modify template files to remove the_date() functions. Most thorough, completely removes from HTML; future-proof with child theme. Requires basic PHP knowledge; risk of breaking site if not done carefully.
SEO Plugins (Schema) Configure Yoast SEO, Rank Math, etc., to exclude datePublished/dateModified from schema markup. Directly influences how Google interprets date information. May not fully remove if dates are still visible in content; schema settings can be complex.

Important Considerations

  • Evergreen Content vs. Timely Content: Removing dates is generally beneficial for evergreen content that doesn't become outdated. For news articles or time-sensitive posts, keeping the date can be helpful for users to assess freshness.
  • "Last Updated" Dates: Instead of removing dates entirely, you might consider showing a "last updated" date. This signals freshness to both users and search engines without making old content seem outdated. Many themes and plugins offer this option.
  • Google's Discretion: While these methods significantly influence Google, Google ultimately decides what to display in search snippets based on its algorithms and user search intent.

By systematically applying these methods, starting with theme/plugin settings and moving to more technical solutions if needed, you can effectively remove dates from your WordPress content and subsequently influence their appearance in Google search results.