Processing WordPress Links

WordPress offers a feature to provide pretty links for your posts.

This would be something like or even or depending on the scheme you choose in your permalink settings.

You may need to process this link to get the actual post id. Say if you are.


  1. Building an API
  2. Redirecting traffic
  3. Using XMLRPC
  4. Writing out an entirely new interface for wordpress.

Good news is that if you have access to the database on which the wordpress installation runs from, this is relatively trivial.

The only part you need to parse is the post name in our case integrating-laravels-auth-with-sentinel  Do a lookup on the wp_posts table post_name column and presto you are done.

A possible implementation of the above steps in Laravel 4.2 would be

The Model to retreive the id

The Interface on which you will code your link parsing algorithm

A simple url parser




Published by


Software Project Manager