Title: Related Posts
Last modified: December 5, 2017

---

# Related Posts

 *  Resolved [54once](https://wordpress.org/support/users/54once/)
 * (@54once)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/related-posts-59/)
 * Hi guys !
    Is there any way to delete or erase all related posts from all my 
   posts ? I was trying to find a plugin but they just made the site very slow. 
   I found something in single.php, the default value is 6 and there appeared 6 
   related posts, I try replacing it with 3 and of course appeared just 3 related
   posts, but when I tried with 0 there appeared like 90 related posts ! Any idea?
   Thanks !
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frelated-posts-59%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/related-posts-59/#post-9754117)
 * it seems that removing this whole section of code from your single.php (ideally
   done in single.php within a child theme) should work:
 *     ```
       					<div class="related-posts wow fadeInUp" data-wow-duration="2s">
       						<h3><?php esc_html_e( 'Related Posts', 'whiteboard64' ); ?></h3>
       						<?php
       			                $related = get_posts( array( 
       			                    'category__in' => wp_get_post_categories($post->ID), 
       			                    'numberposts' => 6, 
       			                    'post__not_in' => array($post->ID) 
       			                    ) );
       			                if( $related ) foreach( $related as $post ) {
       			                setup_postdata($post); ?>
   
       			                    <div class="col-xs-12 col-sm-4">
       					            	<div class="row blog-details wow fadeInUp" data-wow-duration="2s">
       					              		<figure>
       					                		<?php if (has_post_thumbnail()) : ?>
       					                			<?php the_post_thumbnail('full'); ?>
       					                		<?php else : ?>
       					                  			<div class="no-img"><i class="fa fa-camera-retro fa-5x"></i></div>
       					                		<?php endif; ?> 
       					                		<div class="detail-date wow fadeInLeft" data-wow-duration="4s">
       									        	<div class="month-day"><?php echo get_the_date('d M');?></div>
       									        	<div class="year"><?php echo get_the_date('Y');?></div>
       									    	</div>	                       
   
       					                		<figcaption>
       					                  			<div>    
       								                    <?php the_excerpt(); ?>
       					                  			</div>
       					                		</figcaption>
       					              		</figure> <!--figure end--> 
   
       					              		<div class="blog-info">
       					                		<h4><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
       					              		</div>
       					            	</div> <!--blog-details end--> 
       					          	</div>  <!--col-sm-4 end-->  
   
       			                <?php }
       			                wp_reset_postdata(); 
       			            ?>
       					</div>
       ```
   
 * for details, please ask in your theme’s forum at [https://wordpress.org/support/theme/whiteboard64](https://wordpress.org/support/theme/whiteboard64)
 *  Thread Starter [54once](https://wordpress.org/support/users/54once/)
 * (@54once)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/related-posts-59/#post-9754170)
 * Wow !!! It worked !!!
    Thanks a lot Michael !!! You are so kind !!!
    -  This reply was modified 8 years, 6 months ago by [54once](https://wordpress.org/support/users/54once/).

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

The topic ‘Related Posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [54once](https://wordpress.org/support/users/54once/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/related-posts-59/#post-9754170)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
