How to get feed for pages?

We can create a custom feed that’s accessible from here:

example.tld/kellyspagefeed/

and only shows pages instead of posts.

We could try to rewrite the recent answer here, with the following demo plugin:

<?php
/**
 * Plugin Name: Kelly's Page Feed
 * Description: Accessible from the /kellyspagefeed slug
 * Plugin URI:  https://wordpress.stackexchange.com/a/209244/26350
 */

// Add the custom rss2 feed   
add_action( 'init', 'wpse_init' );

// Set the 'page' post type for the custom feed
add_action( 'pre_get_posts', function( \WP_Query $q )
{
    if( $q->is_feed( 'kellyspagefeed' ) )
        $q->set( 'post_type', 'page' );
} );

// Add our rewrite rules and flush only during plugin activation
register_activation_hook( __FILE__, 'wpse_init' );

// House cleaning during plugin deactivation - remove our rewrite rules
register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );

// Helper function
function wpse_init()
{
    add_feed( 'kellyspagefeed', 'do_feed_rss2' );

    if( 'init' !== current_filter() )
        flush_rewrite_rules();  
}

Let’s note that this:

register_activation_hook( __FILE__, 'flush_rewrite_rules' );

will not work here, because we have to flush the rewrite rules after we’ve added our custom feed rewrite rules with add_feed().

So that’s why I introduced the wp_init() helper function:

register_activation_hook( __FILE__, 'wpse_init' );

where we make sure the rewrite rules are not flushed within the init hook. That flush is expensive so we only want to do it when our demo plugin is activated or deactivated.

Hopefully you can adjust this to your needs,