• Resolved olotu

    (@olotu)


    I don’t want my post to display date posted Can anyone please help me on how to do this and till have it available to search engine robots.

Viewing 2 replies - 1 through 2 (of 2 total)
  • bdbrown

    (@bdbrown)

    Hi olotu. The usual way to do this is to use the CSS property “display:none”. However, the problem is that the date in the post-byline is just text so you don’t really have an easy way to manipulate it. What you could do is copy the theme file single.php to a child theme and change the code to add a class to the date portion of the meta data.

    This is the default code in single.php:

    <p class="post-byline"><?php _e('by','hueman'); ?> <?php the_author_posts_link(); ?> · <?php the_time(get_option('date_format')); ?></p>

    You could add a class to the date portion with this:

    <p class="post-byline"><?php _e('by','hueman'); ?> <?php the_author_posts_link(); ?> · <span class="my-post-date"><?php the_time(get_option('date_format')); ?></span></p>

    Then you could target the date with css:

    .single .my-post-date {
        display:none;
    }

    Whether that affects SEO is a topic of much debate.

    There are also other ways to “hide” content. One is discussed in this article:

    https://css-tricks.com/snippets/css/accessibilityseo-friendly-css-hiding/

    Thread Starter olotu

    (@olotu)

    Hi bdbrown, I’ve read the debate and have decided not to hide the date posted. Many thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to remove post date’ is closed to new replies.