Duplicate posts in paginated results

I’m running into an issue where there are duplicate posts appearing in my paginated results. I suspect the issue is to do with my use of paginate_links(), but if anyone can see something obvious in my code, please let me know as I’m stuck.


  • Searching for term ‘magical’ shows duplicate posts in the paginated results.
  • The main loop is also showing duplicate posts towards the end of the paginated results (it’s a bit harder to see as there are lots of posts).


function osu_pagination_exists() {
    global $wp_query;
    return ($wp_query->max_num_pages > 1);

if(osu_pagination_exists()) : ?>
    <nav class="pagination clearfix">
        <?php // Numbered pagination
        global $wp_query;
        $big = 999999999; // need an unlikely integer
        echo paginate_links( array(
            'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
            'format' => '?paged=%#%',
            'current' => max( 1, get_query_var('paged') ),
            'total' => $wp_query->max_num_pages
        ) ); ?>
<?php endif; ?>

Read more here: Duplicate posts in paginated results

Leave a Reply

Your email address will not be published. Required fields are marked *