Answer the question
In order to leave comments, you need to log in
Wordpress close rubric from indexing on homepage?
Welcoming colleagues, please help out, There is a site on Wordpress https://residenciaespanola.ru/ , 2 categories and a blog (all articles) are displayed on the main page from the heading, how can I close them from indexing on the main page? what not to close all page and these 3 categories??? I will be grateful.
Answer the question
In order to leave comments, you need to log in
Do you really understand the meaning of "close from indexing"? There are two ways to close specific pages from indexing:
<noindex>...</noindex>
, Google ignores it Here is an example category
Here is the code that displays it
<?php
// параметры по умолчанию
$posts = get_posts( array(
'numberposts' => 5,
'category' => 12,
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
foreach( $posts as $post ){
setup_postdata($post);
?>
<article class="whant-container__box">
<?php the_post_thumbnail(); ?>
<a href="<?php the_permalink(); ?>" class="whant-article-box whant-article--big box-light-fon">
<div class="whant-content">
<div class="h4 whant-content__title">
<?php trim_title_chars(57, '...'); ?>
</div>
<p>
<?php echo wp_trim_words( get_the_excerpt(), 75 ); ?>
</p>
</div>
</a>
</article>
<?php
}
wp_reset_postdata(); // сброс
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question