Title: Export WordPress links
Last modified: August 18, 2016

---

# Export WordPress links

 *  [dvmorris](https://wordpress.org/support/users/dvmorris/)
 * (@dvmorris)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/)
 * I see that you can import links into wordpress, but is there any way to export
   links from wordpress to another installation of wordpress (of a different version,
   if that matters at all)? Thanks for your help,
 * Dave Morris

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/export-wordpress-links/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/export-wordpress-links/page/2/?output_format=md)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319118)
 * I have a script which collects the links from WordPress and outputs them to OPML
   format. Just tested it and seems to import fine.
 * Example:
    [http://guff.szub.net/links2opml.php](http://guff.szub.net/links2opml.php)
 * Source:
    [http://guff.szub.net/wp-content/sourceprt.php?file=links2opml.php](http://guff.szub.net/wp-content/sourceprt.php?file=links2opml.php)
 * Download:
    [http://guff.szub.net/downloads/links2opml.php](http://guff.szub.net/downloads/links2opml.php)
 * Drop the script file in your blog’s root directory (where wp-config.php is located).
   Use its URL for importing to another WordPress install, or save the output viewed
   through your browser to a file and upload.
 * Note the $show_all variable at the top of the script, which is used to toggle
   display of link visibility set in Links Manager. 1 (default setting) = all links
   display; 0 (zero) = only links set to visible will display.
 *  Thread Starter [dvmorris](https://wordpress.org/support/users/dvmorris/)
 * (@dvmorris)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319255)
 * I’m getting an error when i run this file:
 * <b>Fatal error</b>: Call to undefined function: get_authordata() in <b>/home/
   showviz/public_html/dave/170/opml.php</b> on line <b>18</b>
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319267)
 * (Hmm, why did I use that as a function call in the script?)
 * Fixed. Re-download and try it again.
 *  [josephgibbs](https://wordpress.org/support/users/josephgibbs/)
 * (@josephgibbs)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319285)
 * Hi,
    Installed this on WP 2.0 and receive the following error msg. Any suggestions?
 * Joe
 * XML Parsing Error: not well-formed
    Location: [http://www.bustershome.us/blog/links2opml.php](http://www.bustershome.us/blog/links2opml.php)
   Line Number 67, Column 72:<outline text=”LinuxInsider” type=”link” description
   =”LinuxInsider — “Linux News & Information from Around the World”” url=”[http://www.linuxinsider.com&#8221](http://www.linuxinsider.com&#8221);
   xmlurl=”[http://ww](http://ww) ———————————————————————–^
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319286)
 * Joe, it’s an issue with double-quotes in the description. Just updated the script
   so it converts these to HTML entities.
 *  Thread Starter [dvmorris](https://wordpress.org/support/users/dvmorris/)
 * (@dvmorris)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319289)
 * thanks, that worked beautifully.
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319469)
 * How difficult would it be to modify the code to include categories? For instance,
   if I have links divided into five categories, and only want to export the links
   in Category B, how difficult would it be to modify the code to accomodate?
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319473)
 * “_if I have links divided into five categories, and only want to export the links
   in Category B, how difficult would it be to modify the code to accomodate?_“
 * Not too difficult…
 * Follow the links above for updated script. You’ll now find a $link_cats variable
   at top. Just give the link category ID number as the value:
 * `$link_cats = '2';`
 * For multiple link categories, separate with a comma:
 * `$link_cats = '2,4,6';`
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319474)
 * Thanks!
 *  [dbasulto](https://wordpress.org/support/users/dbasulto/)
 * (@dbasulto)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319491)
 * Hi!
    PHP Worked like a charm, got my .xml file in 2 secs. I see all the links
   there, but when exporting i get:
 * Importing…
    XML error: no element found at line 1
 * Inserted 0 links into category 1. All done! Go manage those links.
 * im exporting from a WP 1.5.2 and importing on a 2.0…
    any ideas?
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319492)
 * Hmm. Just tested an import from 1.5.2 to 2.0, and no problems here.
 * dbasulto, do you have a link to the export (1.5.2) blog, or rather the links2opml
   file therein?
 *  [dbasulto](https://wordpress.org/support/users/dbasulto/)
 * (@dbasulto)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319498)
 * Kafkaesqui, here’s the link to my export:
 * [http://www.plataformaurbana.cl/links2opml.php](http://www.plataformaurbana.cl/links2opml.php)
 * thanks!
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319499)
 * Hmm.
 * I can’t duplicate the error you receive. The url provided rolls right into my(
   2.0) test site’s link importer without a hitch. I was hoping something was throwing
   in an empty line at the start of the script, but nope.
 * dbasulto, can you save the output from your links2opml to a file locally, and
   try uploading that through Import Links? Note: make certain the OPML URL field
   is empty (no ‘[http://&#8217](http://&#8217);) when you do this.
 *  [blogcrafter](https://wordpress.org/support/users/blogcrafter/)
 * (@blogcrafter)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319544)
 * I keep getting this error:
 * Warning: fopen([http://www.ypnblog.com/blog/link2opml.php](http://www.ypnblog.com/blog/link2opml.php)):
   failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required
   in /home/amersky/public_html/blogcrafter-com/ypnblog/wp-includes/functions.php
   on line 2109
    XML error: no element found at line 1
 *  [Robin](https://wordpress.org/support/users/hismuse/)
 * (@hismuse)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/export-wordpress-links/#post-319547)
 * Ok, once I have the link [http://fragilemusings.net/links2opml.php](http://fragilemusings.net/links2opml.php)
   what do I do with it next? Do I save it to my computer?

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/export-wordpress-links/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/export-wordpress-links/page/2/?output_format=md)

The topic ‘Export WordPress links’ is closed to new replies.

## Tags

 * [export](https://wordpress.org/support/topic-tag/export/)

 * 22 replies
 * 13 participants
 * Last reply from: [Oolong](https://wordpress.org/support/users/oolong/)
 * Last activity: [19 years, 3 months ago](https://wordpress.org/support/topic/export-wordpress-links/page/2/#post-319627)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
