Skip to content

Instantly share code, notes, and snippets.

View pedrohenriqueromio's full-sized avatar

pedro-romio pedrohenriqueromio

View GitHub Profile
@joshuadavidnelson
joshuadavidnelson / add-yoast-redirect.php
Last active June 10, 2023 04:47
Programmatically add a redirect to the Yoast SEO Premium redirects.
<?php
/**
* Create a new redirect within the Yoast redirect system.
*
* @param string $origin_url redirecting from.
* @param string $destination_url redirecting to.
* @param int $type redirect code, defaults to 301.
* @param string $format the format, either 'plain' or 'regex', defaults to 'plain'.
* @return void
*/