It’s a complex question. First of all – its works “OK”, from the point of user with no javascript and google-bot. I would suggest fixing this situation in a different way, rather then using page and subpages:
-
Create, not a page but post type
video
with characteristics:- Non-Public
- Publicly queryable
- No Rewrites
-
Add Query Rule
add_action( 'init', function() {
add_rewrite_rule( '^videos/?', 'index.php?post_type=video', 'top' );
});
- Add Custom Parse Query filter.
add_action( 'init', function(){
if ( is_admin() )
return;
add_filter( 'parse_query', function( WP_Query $wp_query) : WP_Query {
if ( 'video' === $wp_query->get('post_type')) {
$wp_query->set('nopaging', true);
}
return $wp_query;
});
});
And its done. Well, not really done. You will need to generate some data attributes for videos on your page-app.