URL Parsing is mostly used by the social networking websites like Google+ & Facebook. URL parsing means whenever you type any URL, the service automatically grabs its details like title and description. Earlier we posted a tutorial for enabling URL parsing/fetching feature in BuddyPress with BuddyPress Activity Plus Plugin. Now, today we will explain you URL parsing in WordPress so that you can fetch any link details inside your posts, pages & other post types.
Unlike to BuddyPress and social networking websites, in WordPress you won’t be needing to auto parse each and ever link. Hence, it would be better if you use shortcodes for parsing links and so that you can only parse the URLs you want and not each and every URL used inside your post content.
Parsing URLs in WordPress:
Parsing URLs in WordPress is also easy. Install and activate Parse URL plugin and start using its shortcode. For Example: Suppose the
url = https://sangkrit.net and if the text is actually under the tag “div class=Normal” then the shortcode can be used as:
[url_parse url='sangkrit.net' url_name = 'Internet Growth Engine' tag_name = 'div class=Normal']
Now next time when one uses any URL of
sangkrit.net then you need not supply the url_name and tag_name as it will be stored in the database.
The plugin fetches meta information with 330 characters the supplied URL. Optionally, it also accepts image parameter wherever you need to supply a specific uploaded image in the post. It takes care of URL forwarding. Optionally it has 2 parameters named url_name and tag_name. The parameters are stored in database as key-value pair. Where url_name is the primary DNS and tag_name is the tag within which the actual text is stored.