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.


I’m having the same trouble with tab highlighting in the Blix theme. I am use the gallery2 embedded plugin and this plugin to direct to that page. I tried sending the page_id in the url, hacking the header.php, and using my site’s full url in the “links_to”, but I haven’t found a way to highlight “photos” when I am on that page. Not a big deal though, still a very useful plugin.
Real nice plugin. Functionality like this should be added to the default WP package. Thank you for your work.
Hey thank you for this plugin….it works great for a client site i’m working on : http://lostsheepoutreachministry.org
I’m using it with static front plugin, so the news page goes to a category page
bless u
comments #86 & #83 gave me all i needed. awesome plugin!
thanks!
e
Great plugin, just what I needed to incorporate my WPG2 Gallery into wordpress.
Thanks!
Pud (http://www.pudweb.com)
Is there any way of getting this to work with the Fold Page List plugin (www.webspaceworks.com/resources/cat/wp-plugins/30/) as the two together break the links_to_target functionality of the Page Links To plugin.
Keep up the great work.
Mark,
Great plugin. I’m using it for my ‘Photo Gallery’ link to my on-site Gallery2 Photo Album.
Only problem I’m having now is - I’m using another plugin ‘kgarchives’ .. which makes up an archives page (fairly common) .. but since I changed the ‘permalinks’ option to the format of ‘archives/123′ instead of the regular ‘?p=123′, I now get an error message from YOUR plugin ironically on the archives page.
I’m no PHP expert by any means - although I’m a computer consultant with my own business .. and try to ‘tinker’ with PHP
- I HAVE noticed that it puts the same error message for EACH archive page that is listed. For instance, with 6 archive pages listed, I get this same error message 6 times at the top of the archives page now:
Warning: Missing argument 2 for txfx_filter_links_to_pages() in /homepages/39/d160125608/htdocs/krussell/wp-content/plugins/page-links-to.php on line 89
Any idea what could be causing it on that line?
I did notice that the ‘kgarchives’ uses the $post (parameter? variable?) in their plugin as well .. but not sure what to make of this.
Thanks,
Kevin Russell
And ah fooey, I meant to ask you this - but notice I can’t edit the comment:
What comment plugin are you using? I LOVE the option to have people subscribe to updates on the comments. That’s just what I’m looking for.
Thanks - Kevin
Okay, now really sorry for the extra comments - a little more research would have answered my question. Must be the ’subscribe to comments’ plugin you have listed under the code section. Very cool. Thanks.
Excellent plugin! Was able to link a gallery using a 3k2 template. Thanks.
I was looking around for something like this, thinking “I bet nobody’s even done a plugin for this,” and I found it. Not only that, but it’s very professionally done. Thanks!
Awesome plugin, works great
it’s exactly what i was looking for.
You can see it working at http://www.bloog.cl
Very nice plugin. Would be nice to turn off test output with an argument or have this removed in the next version.
These lines in particular:
echo “”;
Great plugin, works perfectly for my site “fotos” page. Would it be possible to add children pages to the WordPress page?
Awesome.. just what i was looking for
.. keep up the good work
I’m having a small issue with the plugin - actually, it’s probably more of a style issue, but I thought it would be appropriate to ask here. When I create a new page, it’s displayed with an underline. Is there a way to remove it?
Ah, you can strike my previous post. I managed to fix it. It was a stylesheet error.
This plugin is wonderful!
Excellent plug-in. It’s just what I was looking for. Works like a charm, too.