Site icon Hip-Hop Website Design and Development

Find all URLs for a post

I would like to extract all the links to posts from a wordpress
blog. This seems straight-forward and easy enough to do using
wp-cli. For example:

wp post list --field=url --post_type=post --posts_per_page=-1 --post_status=publish

However, my site is more complicated, because I have changed permalink
structure on my site at one point in time. Now, wordpress appears to
have done the sensible thing here; all the permalinks that existed
before were kept and are being redirected, using 301 redirects. This
is great, for the life of me I cannot find where it is possible to see
these redirects. I have tried searching the wordpress editing
interface and can’t find anything there, and the code reference.

Is there a way to fetch all the URLs that wordpress redirects to
somewhere else? Or all the URLs that redirect to a given post?