Title: Redirect using database information
Last modified: February 6, 2025

---

# Redirect using database information

 *  Resolved [alantygel](https://wordpress.org/support/users/alantygel/)
 * (@alantygel)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/redirect-using-database-information/)
 * Hi,
 * I’m finishing a migration from Joomla to WordPress, and I wan’t to redirect Joomla
   old links to wordpress ones.
 * Joomla’s URL structure for a post includes the post ID, which I have saved as
   a post meta.
 * I wan’t to build a redirect using the information stored in postmeta. For example:
   *
   Source URL: [https://domain.com/article?article_id=123](https://domain.com/article?article_id=123)*
   Target URL: [https://domain.com/](https://domain.com/article?article_id=123)2025/
   02/06/my-beatutil-urlconsidering the my-beatutil-url post has a postmeta key:
   joomla_id, value: 123.I’m aware of `redirection_url_source`and `redirection_url_target`
   filters. However, I can neither access the source URL in the target filter, nor
   modify the target URL in the source filter.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/redirect-using-database-information/#post-18290233)
 * What do you mean by building a redirect? Do you want to import your old data 
   and create new redirects, or do you mean do everything dynamically?
 *  Thread Starter [alantygel](https://wordpress.org/support/users/alantygel/)
 * (@alantygel)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/redirect-using-database-information/#post-18290667)
 * I have around 10k posts, so my first ideia was to create a dynamic redirect which
   captures the old id, searches in database and returns the correct URL.
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/redirect-using-database-information/#post-18290902)
 * Those filters are for modifying existing redirects, and are fired when an existing
   redirect has already matched.
 * It would be better to import all the data into Redirection and just have the 
   plugin run normally.
 *  Thread Starter [alantygel](https://wordpress.org/support/users/alantygel/)
 * (@alantygel)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/redirect-using-database-information/#post-18291741)
 * OK, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Redirect using database information’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [alantygel](https://wordpress.org/support/users/alantygel/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/redirect-using-database-information/#post-18291741)
 * Status: resolved