Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Change document < title > separator

Modify the separator for the document title.

function custom_document_title_separator( $sep ) {
	return '|';
}
add_filter( 'document_title_separator', 'custom_document_title_separator', 10, 1 );