-
Hi,
I’m trying to understand ho to create a redirect programmatically.
I tried adding a redirect directly the database in wp_rank_math_redirections but I think I don’t understand the sources json object correctly.
This is what I added: a:1:{i:0;a:3:{s:6:”ignore”;s:0:””;s:7:”pattern”;s:4:”rood”;s:10:”comparison”;s:5:”exact”;}} but when I look in the admin interface only the url_to show up.
I’m working with a content type that get’s imported and that needs to receive 2 url’s. One real url for the visitor and for SEO but also a shorter one for administration purposes. This shorter one need to be redirected to the long one.Can yu give me an example on how to do that in a plugin? I already looked at https://rankmath.com/kb/filters-hooks-api-developer/ but I’m not sure how to add a redirect.
B.
The ticket ‘Create a redirection programmatically’ is closed to new replies.