Page Links To
About
Page Links To is a plugin that allows you to make certain WordPress pages or posts link to a URL of your choosing, instead of their WordPress page or post URL. 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 point it to the URL of 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 Page 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 “Page Links To” section on the edit screen for that entry and enter in the URL you want to redirect to. If you want this to be a permanent move, you can additionally add a Custom Field 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 2.6 or higher
- 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 — it won’t be used)
- Down below, find the Page Links To meta box and add the URL you’d like it to link to
That’s it! Now, that page will link to the provided URL instead of its WordPress page URL.
Possible Uses
- Linking to an on-site non-WordPress resource (e.g. photo gallery)
- Linking to an off-site resource (e.g. Flickr or Delicious 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.6 The meta boxes in version 1.5 didn’t work on WP 2.5 — my mistake. The plugin requires WP 2.6 now. Fixed a bug where multiple custom fields would be added (if you have dupes, just delete them)
- 1.5 Added WordPress 2.5 meta box — no more custom field-fu!
- 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.


Cool little Plugin, very useful
[...] Page Links To - 本文最简单易用的插件。该插件允许你通过创建“页面”来链接到任何你想要的位置。不必修改代码就能轻松为主菜单添加链接。例如:链接到您的外部相册。您还能通过它创建链接到页面的指定位置,对于制作饭店菜单或大幅页面的小区域链接将非常有用。作者: Mark Jaquith [...]
hey,
what about adding the facility to add a meta ‘links_to_post’ and then quote the post id. Helps when you need to move the site to another server and domain or even to a sub-directory.
Very good plugin and works great on WP 2.5. Thank you very much for your work!
Thank you for taking the time to develop this plugin.
I have installed the plugin but when I go to create a new page I cannot find any reference to it in the templates. Please help.
[...] Page Links To » Tempus Fugit (tags: wordpress plugin) [...]
[...] Page Links To » Tempus Fugit (tags: wordpress plugin) [...]
Great plug-in! I have been searching for something like this for a while.
I have a question:
When I do a re-direct, I want it to open in another tab or at worst another window. How can I do this?
Thanks!
Perfect!
Excellent work in WP 2.5, this one’s a keeper
Yea.. it doesnt seem to be working for me either.. used firefox 2.0, then upgraded to firefox 3.0, and also using ie 6.0.. and none of them popped up into a new window.. for (http://markjaquith.com/) or (http://www.4-14.org.uk/) .. so.. im also using windows xp 64-bit ..
so i dont know if that has anything to do with it.
Anyway I can mask/hide the redirected URL so that my site’s address still shows in the Location bar?
Or as Miguel asked, “How do I embed the linked site so that’s it’s displayed within my wordpress and the user doesn’t end up on another site?”
Tq.
I guess I have the same question as Sandra. I can’t figure out what to set the links_to_target to get the page to open embedded in my blog. Any help would be appreciated, thanks for providing this plug-in.
[...] alternativa, per reindirizzare la pagina all’indirizzo di wordpress potete usare il plugin “Page Link To“. Una volta caricato e attivato il plugin vi create una pagina vuota (nominata ad es. Foto) e nei [...]
Hey there, the plugin is pretty simple at usage. Lightweight and it worked effectively.
Find it hard to figure out what it does at first since it was named to “Page links to”. Thought it was used for linking internal pages.
Now I know what it is and I can link my blog with my other websites.
Thanks for the ultra cool plugin.
Frank did you figure the ” links_to_target ” tag yet?
Pretty simple, it’s like creating or hyperlink your link.
Once you created the “links_to and URL in the custom field. You need to create ” links_to_target ” in a new custom field with value ” _new “.
Your page will save by itself make sure the status Published is set first.
Check you page nav link and click on it. New page will open.
Easy pheasy!
Hope I answered that correctly.
I don’t know if I’m getting this right, but what’s the point of this plugin? I went in (without the plugin), created a new (blank) page for my Flickr library and added “links_to” in the custom field.
What else does this plugin do that I didn’t just do with the above method?
Or am I completely missing the boat here?
For some reason one of the pages I used this on has now replaced my 404 message. So whenever a link is broken the user gets redirected to another site, not the 404. Any ideas?
[...] page links to [...]
Wow and wow again…
I have the latest version (2.5.1) of Wordpress installed and this works great and just as described above.
In short for those who haven’t read properly the full text… Make a dummy page with title and add the Custom Field key lins_to with the URL as value and you have it up and running!
No editing themes/templates to add items to the menu so you can test and change easily. For me that is what really sells it.
Many many thanks.
Mike
[...] Page Links To - 本文最简单易用的插件。该插件允许你通过创建“页面”来链接到任何你想要的位置。不必修改代码就能轻松为主菜单添加链接。例如:链接到您的外部相册。您还能通过它创建链接到页面的指定位置,对于制作饭店菜单或大幅页面的小区域链接将非常有用。作者: Mark Jaquith [...]
It changes the WP-generated link to your page to point to the URL specified by your links_to custom field. If you did it without the plugin, you’d just have a blank “Flickr” WordPress page that didn’t point to your Flickr library!
Hi Mark,
I still haven’t found the solution to embedding the redirected page within my wordpress. Any thoughts?
Den: The ”links_to_target” tag works great if you want the redirected page to open in a new window, but Frank and I want to embed the redirected content. Any ideas?
Thx!
Sandra,
What you want isn’t going to be feasible the way you want without using an
<iframe />or really geeky PHP code. Embedding and redirecting, although they seem similar, are very different, technically.Hey, I’ve had this plugin working fine until I took a page off, then went to add it again with the same value “links_to” and the URL.
When I click “View” in the manage pages tab, it goes to the URL I specified, but when I click the page from my homepage, it adds my domain name in front of it, throwing it off.
Anyone else getting this problem?
How can I remedy this?
Thanks in advance!
EDIT: Okay, so it seems every link I add now, adds my URL in front of it.. anyone know what’s going on? =S
ok, Mark. i’ll go look for iframe/embed plugins then. thanks anyway. =D
Hi,
I am creating a new design for my website with .active highlighting tabs … When I redirect a page to a category using this fantastic plugin the highlighting disappear, and the page seems ‘non-active’. The correct category appears, though … Can someone help me with this please?
Thanks!
It definitely works in 2.5.1 for me
[...] Page Links To [...]
It works in the latest version of WP (nice!) but one thing I don’t like is when I click the comments link for any of my posts, it breaks. It’s looking for:
http://www.posttitlelink.com/#comments
[...] Page Links To - by far the simplest plugin on this list, This plugin allows you to create “pages” that link to something else. It’s the easiest way to add links to your main menu, without mucking around in code. It’s good for adding a link to an external photography portfolio, for example. You could also use it to link to sections of a page, rather than an entirely seperate page, which could be useful for linking to sections of a restaurant menu, or other small sections of a larger page. by Mark Jaquith [...]
Bug: “Illegal offset” on line 95
Fixed by Adding,
if(is_array($id)) $id=$id['ID'];
just below,
$id = ($post->ID) ? $post->ID : $post;
[...] Page Links To Easy plugin to redirect some pages [...]
Very nice this last version 1.5 - but:
The “links_to_target”-Option works only with static pages not with posts.
Does anybody know why… Maybe the solution may be found in these lines:
WHERE post_id = ID AND meta_key = ‘links_to_target’ AND (post_status = ’static’ OR post_status = ‘publish’)
Thanks for helping
I’m sorry…I just can’t figure this out.
The initial links_to works great. If you click on a post that I’ve made look at the links_to, it opens up the re-directed link in the same browser.
But I’m looking for it to open in a different browser.
I’ve tried everything this site has recommended. I created a new links_to_target then in the value section, I put _new. Still nothing.
Any suggestions?
Just saw the new version 1.5 which the notes say
“Added WordPress 2.5 meta box — no more custom field-fu!”
What does this mean?
I just put the plugin in my 2.5.1 site and activated it. When I try to manage a current page or write a new page, I don’t get any sort of linking option anywhere.
[...] have a lot of categories any more, so it looks quite good. Another option could be to use the Page Links To plugin (which I also have installed) and make a page than links to the category listing, but this is [...]
Google Search “how to link wordpress page to a different website”: $0
Finding exactly what I’m looking for: $5 Donation
Not having to ask my husband for help because it was easy enough to do myself: PRICELESS!
My shop thanks you! :o)
~Marianne
Can the Page Links To - Point to this URL be a runtime generated link - or does it have to a specific URL entered there? In other words - generate a desired URL in php in the Page body and use the $url defined in the Point to this URL field.
What would be cool - is if you had a droplist of targets just below the entered link.
Thanks
Marianne, you rock. Thanks for the comment!
Thank you for saving me a load of theme hacking.
Whenever I try and link, it links me to the site I chose but under my own directory. mysite.com/wordpress/www.google.com
(If I linked to google.)
Help
I’m slightly confused… Under usage, you say, “To redirect a page or a post, scroll down to the “Page Links To” section on the edit screen for that entry and enter in the URL you want to redirect to.”
I have activated the plugin in the WP admin panel but when I go to the page I wish to edit in Manage>Pages, there is no “Page Links To” section. I have wordpress 2.51 btw and version 1.5 of your script. What might be my problem?
Hi Mark,
this plugin is one of the excellent plugin i ever see….
you really make my day happy…
thanks a million
ya i know you really deserve some cash for this…
take care
Mukarram
This should be implemented in the next WP build.
So great. Saved my project!
got it work a treat on my blog… cheers mate
Mark,
Thanks for your response! I just realized the stupidity of my question above. I’m using your plug in right now! Thanks so much for it.
Hey man!
Thank you very much for this excellent plugin. If I had a lot of cash Im going to send you some. Godspeed. You rock!
-Jp
Wow what a fantastic plugin, as soon as I get paid into my payoneer I definitely need to make a donation.
I did however try adding a # to the url cause I want to create pages which only act as place holders for subpages in a dropdown but that does not work.
Any advice?
Your plugin is amazing! I’m having a slight problem, unable to get links_to_new to work instead of links_to. links_to seems to overwrite it each time. Am I doing this wrong? Any help/walkthrough would be awesome!
Hey, looks like my last post disappeared. I’ve been unable to figure out how to use the _new feature. Every time i enter a website, it works fine, opens the other page as it should, but since the page i’m linking to doesn’t have a link back to me, I’d like to open it in a new window. The custom field shows “links_to” in the key, and the URL I am using in the value. I try to edit the key to “links_to_new”, but it’s overwritten with a new “links_to”. I feel I am doing this wrong, any suggestions?
Got it working in WP 2.6.1 but not in WP 2.5 guess there is some issue in combination with other plugins.
Will find out later why.
I am using your plugin on WP 2.6.2. On one of my pages I have added a URL to the PAGE LINKS TO section and when I hit save it adds it to the CUSTOM FIELDS section like I would expect it to. The problem I’m having is every time I manage that page and hit save, it duplicates the LINKS_TO custom field. So now I have 4 custom fields with the same KEY/VALUEs. The only way I can remove duplicates is to remove the URL from the PAGE LINKS TO section and click on the DELETE button next to the custom value. Is this supposed to be happening? If so, what happens to the plugin when there are duplicate key/values?
The plugin works great with 2.6.2
howver when i go back to eit a page that has this option its has duplicated the custom field like three times.
is this a problem or why is this doing it?
Thanks for the bug reports. I’ll be releasing a new version momentarily.
the new version seem to be perfect, thanks for such fast work
Great plugin Mark, thanks.
I’ve used it to solve one of those wishes that isn’t necessarily a problem. When I use a drop-down menu, I like the original page in it too. This plugin has enabled me to do that.
Hello, wanted to thank you for your excellent plug-in, but alert you to a problem that I’m having while running Wordpress 2.6
The plug-in does exactly what its supposed to, and I can edit the entries within posts or pages, but when I try to delete a “Page Links To” entry, it won’t delete and just stays there even after I save.
Would be great if you could look into that, thanks.
Smashing plugin!
Question, though: is it possible to somehow still access the post directly despite a page_links_to value being set? Specifically, I still want readers to be able to comment on the articles, even if they’re permalink points to a different news source.
I tried getting clever and replacing the comments_popup_link with bloginfo(’url’).’?p=’.$post->ID.’/#comments’ … but it still goes to the ‘page_links_to value’/#comments in the end.
nomad-one:
Try placing “/www.domain.com/#” (no quotes)… worked for me
Great plugin thanks!
Update… sorry no that doesn’t work lol… it takes you baeck to the main page of the site, don’t know what I was thinking. It would be great if “#” worked though!
Brilliant stuff! I’ve looked for this plugin for soooo long. The team at Wordpress should consider adding this into the mix. Thanks a bunch.
It’s working well at http://www.mountainbikingnewzealand.co.nz if anyone is interested.
Thanks for this plug in.
Hi there, i am using wordperss 2.6.2. and i was wondering how i set a link to open in a new window/tab?
i know in the older versions you just added _blank or _new but what do i have to use now?
Thanks
Hi and I know that I’m being very thick - but I am trying to get a Page to show an XLS sheet which I have converted to HTM. I want to store this sheet within my wordpress.org (ie self-hosting) website.
My questions is/are this?
1. Where do I put the file.htm into my wordpress directories?
2. What do I actually then write for the URL link? - I tried the full https:// etc etc and it threw up all sorts of IE7 warnings.
You’re very kind to help an almost 60 year old newbie!!
B
Hi, Your plugin works briljant, I only have one question.
I’m using your plugin to show all message in one catogory on a special (tab)page. This works fine. Only when I click the tab ‘portfolio’ I’m going to the correct site with the correct messages, only the tab doesn’t hylight. So you still think your on the home page.
Can you tell me how I can fix this?
Thanks!
thanks for this plugin. helped me do exactly what I wanted.
@Boydy - take a look at scribd (http://www.scribd.com/) and then the wordpress plugin to embed almost any kind of document (I think it’s called wp-ipaper).
Call it a link to an internal Page or a link to an external source, a link is still just a link. This plugin allows you to change that link so when a user clicks it, they’re taken to an external website. Hmm.
This idea could hardly be simpler. Haven’t links been around since the early 90s?
PS. What’s wrong with including an external link in your sidebar?
It seems the method to open in a new browser page no longer works in WordPress 2.6.2 as richard mentioned above.
Also, Hannes Schwarz is onto something when specifying that the link_to_target = _new only works with static pages, not posts.
Hello,
Thanks for the plugin. It solved my problem of integrating my blog, forum and main web site.
With best wishes,
Krishna Chaitanya
http://www.jytra.com
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)…
It should in the Page Links To meta box down below, has a can setup Target of box. Better!
This is great!!
Exactly what I was looking for. Please publish this plugin at Wordpress.org so everyone finds it
The redirect works but in the sitemap the redirect page shows up instead of the created wordpress page, thus causing an error (Google Webmaster) that “this URL is not allowed on this site map”. How do you prevent this error?
Thanks,
Nikko
Nice to find such a plugin,
i will try it as fast as i can
Big Thank you
take care
Alpha
Great plug-in. Has helped me link my main site and my blog, after mucking around unsuccessfully with the .htaccess file.
Thanks for this works, I tried this plug in and found it works well and match to …
Thanks Mark!… really appreciate your work, it’s very useful!
This is fantastic!!
I’ve been wanting to do this for ages and just stuck manual links in the template
This is so much cleaner and simpler.
Thanks a bunch
Thx for this plugin
But i have a problem.
when you click Send me an error “null”
Example : mydomain.cl/null
“null” all te link in wp send me an “null”, in the forums in my site and other external links.
What is the problem
Now the plugin is disabled
thx in advance
Nikko,
If URLs on other domains aren’t allowed in a Site Map, the Site Map plugin should inspect the domain of each URL and omit any URLs from other domains.
Olof, it is published on WP.org.
Am I the only one left with a problem with getting a NEW browser window to open when the link is clicked?
I am using WordPress 2.6.3, Page Links To version 1.6, and IE7 browser.
Here is how my fields appear in the Custom Fields section of the post:
KEY VALUE
— ————
links_to http://www.google.com
links_to_target _new
Is there anything wrong with what I have done that it won’t launch in a new browser window?
The formatting of the above post may a appear a little confusing. I’ll try a different way…
KEYS:
links_to
links_to_target
RESPECTIVE VALUES:
http://www.google.com
_new
HI,
Mi blog are in http://www.lesguerreres.org/noticias and i want the first site of the menu is http://www.lesguerreres.org
can i change the place of pages or position?
Thank you
Would it be possible to allow adding anchors to “Page Links To”?
[a href="#"]
[a href="#example"]
Or the ability to add javascript?
[a href="javascript:etc"]
Right now you can only input internal links or external links…
Thanks for reading!
-Ray
Has anyone figured out how to set the redirect to open in a new window? I can’t get this to work…
Has anyone figured out to get the redirect to open in a new window? I can’t figure out how to make it work. Thanks!
Thanks this is great! But how if I want to add an agreement in the form?
Great Plugin Mark!! Thanks!!
Thank you so much! this is exactly what i have been looking for!
Beautiful wishes, ana comfort santa suite, :[[[, hotel marta santa, =PPP,
Complimenti per idea del sito. Anche noi siamo amanti del trekking. Perche non organizziamo un incontro di appassionati per delle escursioni insieme? Magari non piu di 6-8 in tutto? Un saluto.
mi ro
sara jay
film erotici
sonata
I´ve the same problem like some folks above.
There is no “Hightlight” for the aktive page. I linked to a category overview. Also in the script is some code about “current page-item” but i can´t understand it unfortunetly.
Hmmm. I love this plugin. Unfortunately, though, I find that once I enter a value in the Page Links To field, I can never clear it. I’m stuck with linking to a different page. If I clear the field and save the page, it automatically puts the value back in. I accidentally added a URL on a page that I did not want linked. Is there any way to clear it without manually editing the database? Thanks!
Great plugin, thank you. Too bad this isn’t built into wordpress.
Great plugin! Thanks!
I am having one problem, though, if I put a link on a page and then decide to remove it I can’t it keeps reappearing…
thanks again!