0

I created a Custom Post type for my client's site, and everything works fine. but, I found that google index an archive page that I do not want. here is the code of my Post Type:

    $apres_repas_options = array(
    'labels' => $apres_repas_labels, // array of : name , singular_name ......
    'description' => 'Holds our Après repas and pizza specific data',
    'public' => true,
    'menu_icon' => dirname(plugin_dir_url(__FILE__)).'/assets/images/after-meal.png',
    'supports' => array('title', 'excerpt', 'thumbnail'),
    'has_archive' => true,
    'rewrite' => array(
        'slug' => 'apres-repas'
    )
);

and this the URL that google index and i don't want :Pizza Halal à Vauréal

thank your for your helps

  • So set 'has_archive' to false... – Jacob Peattie Dec 31 '18 at 15:31
  • you may want to go into googles webmaster too and tell it not to index that page as well if it's already been indexed. – rudtek Jan 3 at 18:04
  • i have change the has_archive to false , but wordpress display now a page with body class <body class="blog ...."> – Younes Jan 4 at 17:45
  • rudtek , hi , i try to add tag noindex , nofolow but stil google explore this page – Younes Jan 4 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.