Skip to content
neve

Save hours, not minutes – launch faster with 110+ patterns, powerful pro tools, and priority support when it counts!

See Pro Plans →

Infinite Scroll Security & Query Sanitization

Starting with Neve v4.2.3, the theme implements a strict sanitization layer for infinite scroll query arguments to prevent query manipulation and ensure site security and performance.

Allowed Query Parameters

When using infinite scroll, only the following WP_Query arguments are permitted:

ParameterDescription
category_nameFilter posts by category slug
tagFilter posts by tag slug
sSearch term
orderSort direction: ASC or DESC
orderbySort field: date, title, author, modified, comment_count
authorFilter by author ID
author_nameFilter by author login name
yearFilter by year
monthnumFilter by month number
dayFilter by day of the month
post_typePost type (must be a publicly queryable post type)

Restricted Parameters

For security reasons, the following parameters (among others) are explicitly stripped from public infinite scroll requests:

  • meta_query, meta_key, meta_value
  • tax_query
  • post__in, post__not_in
  • fields

Any argument not in the allowlist above is removed before the query is executed.

Customizing the Query

If you need to filter or extend the infinite scroll query beyond the allowed parameters, use the standard WordPress pre_get_posts action hook on the server side instead of passing custom arguments through the client-side request:

php
add_action( 'pre_get_posts', function( $query ) {
    if ( $query->is_main_query() && ! is_admin() ) {
        // Your custom query modifications here
        $query->set( 'meta_key', 'featured' );
        $query->set( 'meta_value', '1' );
    }
} );

This approach keeps query logic server-side where it cannot be manipulated by end users, and works correctly with Neve's infinite scroll implementation.