Page Links To
About
Page Links To is a plugin that allows you to make certain WordPress pages or posts link to a URI of your choosing, instead of their WordPress page or post URI. It also will redirect people who go to the old (or “normal”) URI to the new one, using a redirect style of your choosing (302 Moved Temporarily is standard, but you can enable 301 Moved Permanently redirects i f you wish.)
For instance, say you have a photo gallery installed, but can’t be bothered to integrate it into WordPress. You’ll still probably want to have a link to it from your WordPress blog. With this plugin you can create a new page called “Photos,” and give it a Custom Field links_to with the value being the URI to your photo gallery. “Photos” will show up when you use wp_list_pages();, but instead of linking to the (blank) “Photos” page, it will link you your photo gallery!
Another usage scenario is that you have content that was on a post, and want to move it to a page. You could redirect the post to the new page. And if you use a 301 redirect, search engines will eventually “find” the new location and change their links.
This plugin uses only two simple MySQL queries, no matter how many total pages or links_to enabled pages you have, so you don’t have to worry about scalability.
Usage
To redirect a page or a post, scroll down to the “Custom Fields” section on the edit screen for that entry and enter in a key of links_to with the value being the full URI you want to redirect to. If you want this to be a permanent move, you can additionally add a meta key of links_to_type with a value of “301″ (without the quotes). After saving the entry, the redirect will be active!
New in version 1.3: Now you can create a links_to_target meta key, and provide the target you would like for the link (like _new, to open the link in a new window). The target you choose will be used in wp_list_pages().
Download
Instructions
- Upgrade to WordPress 1.5.1.3 or higher (WordPress 2.0 required for tab highlighting feature)
- Upload
page-links-to.phpto your/wp-content/plugins/directory - Activate the “Page Links To” plugin in your WordPress administration interface
- Create (or edit) a page to have a title of your choosing, and a parent page of your choosing (leave the content blank)
- Down below, add a meta key of “links_to” (without the quotes) and give a full URI as its value
That’s it! Now, that page will link to the “links_to” URI instead of its WordPress page URI.
Possible Uses
- Linking to an on-site non-WordPress resource (e.g. photo gallery)
- Linking to an off-site resource (e.g. Flickr or del.icio.us page)
- Placing a link to a 2nd, 3rd, or nth level page on the top level (i.e. you might have
/archives/tags/, but want “tags” to show up on the top level) - Adding a link to your blog’s front page without having to modify your template and hack it in manually
Leave any bug reports or feature suggestions here in the comments.
Versions
- 1.4 Fixes to tab highlighting
- 1.3 You can now specify a link target via
links_to_target, tab highlighting moved to WordPress 2.0 style - 1.2 If you link to an internal WordPress page, like a category, the menu item will get the
current_itemCSS class when you’re on that page - 1.1 Posts can have redirects, can specify redirect type (301/302),
get_permalink()is filtered for posts. - 1.0 Initial public release.


Thanks Paul,
I found and removed the hardcoded link from the header and added the main page again as a page using this plugin. Only problem now is that no tab is highlighted by default.
I’m allmost there I suppose..
The problem with the double highlights doesn’t lie with page_links_to but with the WPG2 plugin. This plugin fails to provide the information needed to do the highlighting correctly. In the WPG@ case, page_links_to simply redirects (to yourpage/wp_gallery2.php usually) and isn’t the code that does the actual embedding hence this problem can’t be due to page_links_to
In my test-setup i use the K2 theme, which i hacked by replacing one line in header.php:
if (((is_home()) && !(is_paged())) or (is_archive()) or (is_single()) or (is_paged()) or (is_search())) {with
if ((((is_home()) && !(is_paged())) && !($g2_wp_init)) or (is_archive()) or (is_single()) or (is_paged()) or (is_search())) {This simply checks whether WPG2 is active and if so applies the right case. In case you ever disable WPG2 this should still work since PHP defaults to ‘false’ for unknown variables.
Thank you Liessa,
I wasn’t sure if I needed to add/hardcode the link to the Blog page to the header again. I tried 3 scenarios:
With hardcoded link:
When the page is loaded the Blog-tab is properly highlighted, after I click the galley tab this allso gets highlighted (so they both are) until I enter an album, then it only highlights blog.
Without hardcoded link, using links_to to point to my blogs index.php:
When the page is loaded no tabs are highlighted, after I click the galley-tab this gets lit, but only untill I open an album.
Blog-tab only highlights after clicking it.
(current state of my site)
Without hardcoded link using links_to to point to my blogs folder:
When the page is loaded blog-tab is and stays highlighted.
Very nice! I have some LJ with news, check this out:
Newest news
Check this out
livejournal
Very nice! I have some LJ with news, check this out:
Newest news
Check this out
livejournal
Thanks for such an awesome plugin!!! Only question i have is once i make a new page WP creates a new tab, how do i shift the tabs around without del the page and remaking them them in the order i would like them to be?
Boyd: If I’ve understood your comment correctly it should be a matter of reordering the pages. I’m not too familiar with Wordpress but I’m not sure if this can be done easily without a plugin. To do it ‘manually’ at least - on each page, somewhere on the bottom right there is a ‘page order’ box. I use that but there must be a better way
Thanks so much! Great plugin and much better than hardcoding everything
awsome plugin keep up the good work
This is phenomenally easy. Thank you for sparing me convoluted php rewrites. I have a phpLD on the same server as my artsmontana blog and I wanted the directory to appear in the main menu and the sidebar where wp_list_pages does its stuff. I figured a custom field on the old WP page where I started the directory (ugh) would do the work. But then what? Then Links To, that’s what. Feenominal, too, since I made a modest donation. Wish I could have done 5 times that. Not only is the solution elegant, your instructions are, too.
Boyd,
RE WordPress page ordering:
Set the page order for each page in Manage > Pages. Then edit wp_list_pages to make it use the ordering you’ve established. If you are ordering the pages for a main menu, put the wp_list_page edit in header.php.
This code following my blog banner div did the trick:
I let the sidebar instance of wp_list_pages default to alphabetical ordering, but you can change the code there, too. You can call this list anything; the example uses “PAGES”:
‘ . __(’PAGES’) . ” ); ?>
All of this is swell if you don’t have a lot of pages to go and set PAGE ORDER for. (Note that you don’t have to delete pages and recreate them to get the right ordering of IDs; this is something you do on each page in the PAGE ORDER box at bottom right when you edit a page.)
Darn.
I was assuming I was in text editing mode. But I see my post is messed up and doesn’t show the code. I’m new at this blog commenting thing. Maybe it was the php (for security reasons?) that messed things up.
Apologies to all readers and our blog host for the wasted space.
Look at this WordPress Codex page. All will be answered there. (And I hope this HTML word here.)
Red in the face.
Hi,
I’m really new at this…
On my site I want the Flickr page to open IN the blog and not in a new page. I already managed to make a link, but it opens in an new page.
What am I doing wrong???
They really should have included something like this in Wordpress as standard. Thank you so much =)
Regards Tim, from Sydney Australia
I have used this plugin on a few sites in the past and it’s excellent. On a recent site I have been working on I thought about using it to force specific pages through the site’s SSL certificate. So, using an absolute https:// address on specific pages. It doesn’t work, however, and it’s not obvious to me why this is. Any thoughts on this would be greatly appreciated.
Cheers,
Brandon
Fantastic plugin, can’t believe something like this isn’t standard in WP. I’d like to echo Serena’s question above, is there any way for the linked page to open up in the content pane of my site, so that the navbar, header, and footer are still visible?
Thanks,
Michael
Wonderful plugin. Is there any way of making the links relative? It’s just when I build a WP site on my local computer, I’ve got to go through and change all the ‘links_to’ links when the site goes live because all the urls are different.
Hello!
nfl-ersey
nfl+ersey
jersey-size
nfl-jersey-card
lady-nfl-jersey
Thenk!
hi!
thanks for the great plugin!!! i really needed that and didn´t came across the hardcoded thing.
but one thing is left:
how can i add a e.g. class=”thickbox” to the link so i can open it cia thickbox?
would be great if you could help me out…
cheer from austria
guybrush
I didnt even know this plugin existed! I was getting ready to take a machete to my blog’s code. Thanks
I don’t understand why it doesn’t work… I want a category to be in the pages … but.. i really just don’t know why. I tried doing as instructed. 4 times .. but the category page still won’t show up.
Strange… tried creating a page with link to myGallery2 but when activated AND adding custom key it constantly creates a draft post. What a pity
Maybe its my themes fault: Intense.
I switched theme to WordPress default but with the same result…
After deactivating almost all my plug-ins I discovered Kiras post #260 about my problem above. Her workaround on the WordPress (!) bug, when creating pages which are then saved as draft posts, helped me.
So thanks Kira and thanks Mark for making time easier, at least sometimes
We(China) manufacture and export Aftermarket Auto Parts,Auto Parts,Stainless Steel (Seamless/Welded)Pipe(Tube),Door Hardware,Hydraulic Pressure,Industrial Fastener/Fastener(Standard part)…
Awesome plugin. Thanks!
It would be nice if you put a blurb on ALL of the keys that can be used in the custom fields & how it is done. I had to search thru all your comments to find out how to use the link_to to open a _new window.
Great tool!!
Thank you very much for authoring this incredibly useful plugin. I have put it to good use, and appreciate your work very much!
I am unable to download the plugin. Is it available anywhere else?
I’m trying to pull in a page from google finance as an integrated page into my main page by clicking on the Quote link.
Per the instructions, I created a blank page QUOTE as a parent, then created a 2nd page (Quote Mot) with the links_to key and a value of http://finance.google.com/finance?q=MOT however when I press the Quote button on my main page it opens the 2nd page to an empty link.
If a omit the 1st page and reference the link directly it opens in a new window.
Is there a way to show the link_to page http://finance.google.com/finance?q=MOT in my blog, I knew that I used to be able to do this in my PHPNuke site with a little plug-in and was hoping to find something similar with this.
Hi,
is it possible to do something like:
http://www.the-device.net/
with this plugin…?
thx for help
Hi,
i entered links_to_target and _new but the link is still opening in the same browser window?
thx for help
yes
i entered links_to_target and _new but the link is still opening in the same browser window?
thx for help
with this plugin…?
thx for help
Per the instructions, I created a blank page QUOTE as a parent, then created a 2nd page (Quote Mot) with the links_to key and a value of http://finance.google.com/finance?q=MOT however when I press the Quote button on my main page it opens the 2nd page to an empty link.
Thank you very much for authoring this incredibly useful plugin. I have put it to good use, and appreciate your work very much!
I’m trying to use the plugin for my pages and I’m not sure how to implement the meta key:
- Down below, add a meta key of “links_to†(without the quotes) and give a full URI as its value
How do I get custom fields to show up like they do in posts? or is there something else I’m overlooking?
Thanks
I installed plaugin but where is the step 5 part where it says
Down below, add a meta key of “links_to†(without the quotes) and give a full URI as its value.
Where is the down below?
Fantastic, I’ve figured it out. this plugin rocks. Thanks so much, I was a very frustrated noobe trying to figure this out. Thanks again
thanx works great!
thank you for free download
Very good blog thank you..
youtube kraloyun oyun youtube oyunlar güzel sözler youtube
thankss you
thank you
nediyo olum bu
hadii
Thank you friend