Custom permalink for each post

im importing data from Drupal to WP. I have more than 10 000 posts. Each post have ID, category and slug. For example:

  • Category> important
  • ID> 11111
  • Slug> hello-world

I need to keep permalinks same like they are on drupal because of SEO:

www.wordpress.com/important/11111-hello-world

The problem is that, i cant insert post with ID 11111 until is database index set to this number. If i do import, this post will actually much smaller, never the same like on drupal.

I wanted to make post-meta with old url. For example

  • _oldSlug> 11111-hello-world

And then apply rule: If is set post-meta named "_oldSlug" use it (%category%/_oldSlug), else use wp logic (%category%/%postid%-%postname%). But problem is, that i dont know how to achieve it, if is that posible...

Any idea how solve this problem?

Topic post-meta guids permalinks posts Wordpress

Category Web


Migrating content from Drupal to WordPress is bit tricky task and requires expertise. If you are familiar with WordPress development, try to find some solution around "save_posts" hook which will get triggered whenever new post/page gets saved into database. Before you jump into actual coding, I suggest you to take a look at these articles, to get more understanding about Drupal to WordPress migration.

From Drupal To WordPress

How To Migrate From Drupal To Wordpress

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.