I have a page: https://med.uth.edu/ortho/houston-ortho-trauma/
I have discovered this as well: https://med.uth.edu/ortho/houston-ortho-trauma/embed/
There is no page for that second URL, and I cannot find a way to remove it.
Any thoughts?
I have a page: https://med.uth.edu/ortho/houston-ortho-trauma/
I have discovered this as well: https://med.uth.edu/ortho/houston-ortho-trauma/embed/
There is no page for that second URL, and I cannot find a way to remove it.
Any thoughts?
This pages can be generated in WP, or by plugins and are intended to allow the page to be embedded on other websites. If you do not want them they can be "removed" via an .htaccess rule:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.*)/embed/?$
RewriteRule ^(.*)/embed/?$ %1 [R=301,L]
Or a custom function in your functions.php file:
function disable_embeds_code_init() {
// Remove the REST API endpoint.
remove_action('rest_api_init', 'wp_oembed_register_route');
// Turn off oEmbed auto discovery.
add_filter('embed_oembed_discover', '__return_false');
// Don't filter oEmbed results.
remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);
// Remove oEmbed discovery links.
remove_action('wp_head', 'wp_oembed_add_discovery_links');
// Remove oEmbed-specific JavaScript from the front-end and back-end.
remove_action('wp_head', 'wp_oembed_add_host_js');
}
add_action('init', 'disable_embeds_code_init', 9999);
You can read more about oembed links here: What are the Oembed Links For?
If you check your source code you will see the links, they start with:
link rel="alternate" type="application/json+oembed"
/feed
to an archive URL to see it as an RSS feed, or/2
for the second page