first Log in to your WordPress website you have to change the tags
then Go to the post or page for which you want to change the canonical URL.
after that go to the editing screen and then go to the ‘Advanced’ section in the Yoast SEO sidebar or meta box.
there Enter the full canonical URL, including http/s and www or non-www, in the ‘Canonical URL’ field.
and lastly Update the post, page, or taxonomy.