WordPress.org

Ready to get started?Download WordPress

Forums

Export WordPress links (23 posts)

  1. dvmorris
    Member
    Posted 8 years ago #

    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

  2. Kafkaesqui

    Posted 8 years ago #

    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

    Source:
    http://guff.szub.net/wp-content/sourceprt.php?file=links2opml.php

    Download:
    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.

  3. dvmorris
    Member
    Posted 8 years ago #

    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>

  4. Kafkaesqui

    Posted 8 years ago #

    (Hmm, why did I use that as a function call in the script?)

    Fixed. Re-download and try it again.

  5. JosephGibbs
    Member
    Posted 8 years ago #

    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
    Line Number 67, Column 72:<outline text="LinuxInsider" type="link" description="LinuxInsider -- "Linux News & Information from Around the World"" url="http://www.linuxinsider.com" xmlurl="http://ww
    -----------------------------------------------------------------------^

  6. Kafkaesqui

    Posted 8 years ago #

    Joe, it's an issue with double-quotes in the description. Just updated the script so it converts these to HTML entities.

  7. dvmorris
    Member
    Posted 8 years ago #

    thanks, that worked beautifully.

  8. Chip Bennett
    Theme Review Admin
    Posted 8 years ago #

    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?

  9. Kafkaesqui

    Posted 8 years ago #

    "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';

  10. Chip Bennett
    Theme Review Admin
    Posted 8 years ago #

    Thanks!

  11. dbasulto
    Member
    Posted 8 years ago #

    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?

  12. Kafkaesqui

    Posted 8 years ago #

    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?

  13. dbasulto
    Member
    Posted 8 years ago #

    Kafkaesqui, here's the link to my export:

    http://www.plataformaurbana.cl/links2opml.php

    thanks!

  14. Kafkaesqui

    Posted 8 years ago #

    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://') when you do this.

  15. BlogCrafter
    Member
    Posted 8 years ago #

    I keep getting this error:

    Warning: fopen(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

  16. Robin
    Member
    Posted 8 years ago #

    Ok, once I have the link http://fragilemusings.net/links2opml.php what do I do with it next? Do I save it to my computer?

  17. Kafkaesqui

    Posted 8 years ago #

    You can save it, but if you're trying to import links from it into another WordPress installation, you can just point to it (Links > Import Links).

  18. mule
    Member
    Posted 8 years ago #

    I get the follwoing error when I run your script:

    XML Parsing Error: xml declaration not at start of external entity
    Location: http://mywebsite.net/links2opml.php
    Line Number 3, Column 1:<?xml version="1.0" encoding="UTF-8"?><!--Links2OPML - a WordPress script created by Kaf Oseo (http://szub.net)

  19. lee_harding
    Member
    Posted 8 years ago #

    hello... hope you can help...

    i tried the script but get a database error -

    http://www.leeharding.net/wp-links-opml.php

    can you have a look see if im doing something silly....

    thanks

    Lee

  20. gutielua
    Member
    Posted 8 years ago #

    It's possible to Export WP Links, to IE o FF?

    Regards!

  21. annvol
    Member
    Posted 8 years ago #

    what kind of file should save as when saving the output? and what should i name it? and where should i upload it to?

  22. lcf
    Member
    Posted 8 years ago #

    the script works great! thanks!

  23. Oolong
    Member
    Posted 7 years ago #

    It's not working for me - when I try to import direct from http://www.mimeomai.f2s.com/oolong/ac/sourceprt.php it gives me 'XML error: syntax error at line 1

    Inserted 0 links into category 1. All done! Go manage those links.'

    Interestingly, saving the file and then importing it gives me the subtly different 'XML error: not well-formed (invalid token) at line 68

    Inserted 0 links into category 1. All done! Go manage those links.'

    ...any suggestions?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags