Custom function that re-writes page title breaks when the Yoast plugin is activated

Well .. for those of you who might be interested, this is how I succeeded at overriding the Yoast plugin conflict with my 404 page titles:

  1. I added a simple custom method to my mu-plugin file that retrieves the property address:

    function get_property_address() {
    global $parsed_address;
    return $parsed_address;
    }

  2. I added this custom method for creating a custom Yoast variable to my functions.php file:

    function register_custom_yoast_variables() {
    wpseo_register_var_replacement( ‘%%propertyaddress%%’, ‘get_property_address’, ‘advanced’, ‘some help text’ );
    }

    add_action(‘wpseo_register_extra_replacements’, ‘register_custom_yoast_variables’);

  3. I went in to my Yoast Settings (ie: Search Appearance > Special Pages > 404 pages) and added the “%%propertyaddress%%” custom variable to my 404 page title.