How do I get the URL section to show use a different domain in the WordPress Admin?
You can use the post_link filter to do this. Example: function modify_post_link( $url, $post, $leavename=false ) { if ( $post->post_type == ‘post’ ) { $url = str_replace(home_url(), ‘https://preview.domain.com’, $url); } return $url; } add_filter( ‘post_link’, ‘modify_post_link’, 10, 3 ); In fact, with this you don’t even need your previous filter for get_sample_permalink.