Add/Modify rel=canonical of all the pages of a wordpress website

You’ll want to prevent SEO plugins from adding a canonical meta tag, and then add your own canonical meta tag using wp_head filter (untested):

add_action( 'wp_head', static function () {
    $url = trailingslashit( get_site_url() );
    $url .= ltrim( $_SERVER['REQUEST_URI'], "https://wordpress.stackexchange.com/" );

    printf( '<link ref="canonical" href="%s" />', esc_attr( $url ) );
} );

File not found.