How do I use WP_Query to get a range of posts with custom fields that have numbers with letters in them?
Intercept the query on the posts_where filter. In there you can do a replacement of the non numeric values: preg_replace( “/[^0-9,.]/”, “”, $yourMeta ); Or in a (generic) code piece: add_action( ‘posts_where’, ‘wpse120784WhereDiameter’, 100 ); function wpse120784WhereDiameter( $where ) { // If conditions here – only target the cases where we need it # if … Read more