Published on Oct 25, 2021
How to remove “Oxygen Visual Editor” from page titles in Oxygen
Sridhar Katakam
Oxygen editor pages have “Oxygen Visual Editor” in the titles by default.
Ex.: Oxygen Visual Editor - Sample Page - Oxygen
where the last title part, Oxygen
in this case is the site title.
If you have a number of tabs open in your browser you may be looking to remove that so the page titles are compact like this:
Sample Page - Oxygen
This can be done using the following PHP snippet:
add_action( 'init', 'custom_is_show_builder', 1 );
function custom_is_show_builder() {
if ( isset( $_GET['ct_builder'] ) && $_GET['ct_builder'] ) {
remove_filter( 'document_title_parts', 'ct_builder_wp_title', 10, 1 );
add_filter( 'document_title_parts', 'custom_builder_wp_title', 10, 1 );
}
}
function custom_builder_wp_title( $title ) {
$title['title'] = ( isset($title['title'] ) ? $title['title'] : '' );
return $title;
}
It can be added using a plugin like Code Snippets.
If you want to have the titles in this format:
O2 - Sample Page - Oxygen
replace
$title['title'] = ( isset($title['title'] ) ? $title['title'] : '' );
in the above with
$title['title'] = ( isset($title['title'] ) ? 'O2 - ' . $title['title'] : '' );
Reference: /wp-content/plugins/oxygen/component-framework/component-init.php.