Preserve Word's bookmarks and hyperlinks in a WordPress post
-
I am using MS Word to create a new post for my WordPress.com website. The .doc file contains bookmarks and hyperlinks. How do I preserve these links when I post into the Add Post window? Do I need to edit the HTML?
The blog I need help with is: (visible only to logged in users)
-
Pasting from Word is tricky business. The program adds formatting that can cause problems in blogging software. That having been said, sometimes it works well, and sometimes you end up needing to do some cleanup. The best way to find out if your particular Word document will paste cleanly is to try it and see what happens.
Here’s more info about what works and what doesn’t:
Let me know if you have any questions, or need help cleaning up some unwanted code after you paste.
-
Thanks LizTheFair (nice moniker by the way). I had already tried pasting a simple test .doc file with a bookmark and hyperlink and it didn’t work: hence my question. Before I dig deeper into the whys and wherefores and get messy with HTML, can I paste cleanly i.e. without any bookmarks and hyperlinks, and then insert the bookmarks once I’m in the WordPress.com post editor? If so, presumably I can then use the Link facility to hyperlink to the bookmarks. Ben
-
PS. I read through the MS Word support document you mentioned – thanks. I know that saving as a .doc or .docx adds all sorts of extra formatting stuff. If this becomes a problem, I’ll Save As a .txt file before pasting into the WordPress.com Post editor to strip out the formatting code – what Smashwords calls the nuclear technique! There was no mention of bookmark/hyperlink preservation in the WordPress support document however. Ben
-
Hi Ben,
I had already tried pasting a simple test .doc file with a bookmark and hyperlink and it didn’t work: hence my question
Did you paste your test into the visual editor? If so, that should have worked.
Could you create a test post with a direct copy/paste? That way I can take a look and give you a better idea of how much, if any, clean up work you’ll need to do.
-
Liz:
Thanks for your reply. Here’s what I’ve done. I created a simple Bookmark/Hyperlink test file in Word and then copied and pasted the text into the WordPress.com Post visual Editor. I then switched to the text view to see the HTML and copied the text. Here it is:
————————Start of test file—————————————
Word marriages
Have you noticed:
Hot food is always <span style=”text-decoration: underline;”>piping</span> hot
Vistas and sunsets are always stunning
Revelations are always earth shattering
Flowers are always gorgeous
Journeys are always epic
Marriages are always made in heaven
Tomes are always weighty
Footage is always shocking
…
Piping: very hot. <span style=”text-decoration: underline;”>Return</span>
————————–End of test file—————————–
In the Visual view, I can see the words ‘piping’ and ‘Return’ underlined and in a different colour which indicates that the hyperlinks are there but when I publish the post, privately, although the two words are still underlined, clicking on them does not move me forward or backward through the file as it would if I was doing this in the original MS Word file.
Are my expectations too high? Ben
-
Addendum. I’ve just noticed that the words I bookmarked in the original ,doc file are no longer bookmarked in the WordPress text file. In the original .doc file, the word ‘Piping’ in the definition line at the bottom was bookmarked, and the first word ‘Hot’ in the line ‘Hot food is always hot’ is bookmarked to facilitate the Return jump. I’m an HTML newbie and thus need to go away to discover how to add bookmarks in HTML. If you can tell me, or show by insertion in my test file, that’ll be a great help. Thanks, Ben
-
Yet more. I’ve abandoned trying to preserve Word-inserted bookmarks and hyperlinks. I’m now looking at how to do it in the WordPress.com text editor. Take a look at this:
—————————————————————–
Word marriages
Have you noticed:
Hot food is always <span style=”text-decoration: underline;”>piping</span> hot
Vistas and sunsets are always stunning
Revelations are always earth shattering
Flowers are always gorgeous
Journeys are always epic
Marriages are always made in heaven
Tomes are always weighty
Footage is always shocking
…
Piping: very hot. <span style=”text-decoration: underline;”>Return</span>
——————————————————————-
I think the HTML syntax for the and statements are okay and the jumps do occur when I publish and view the post but the jump moves to the line just below where I’ve inserted the bookmark rather than to the bookmark itself. Do I need to reposition the statement?
Ben
-
Oops. In the last paragraph of the last post, I had typed abbreviated forms of the HTML statements. The last paragraph should read:
… for the ‘opening chevron a name … closing chevron’ and ‘opening chevron href … closing chevron’ statements are okay … … need to reposition the ‘opening chevron a name … closing chevron’ statement?
I’ll have to watch that one! Ben
-
Also, I now notice that the ‘opening chevron a name … closing chevron HTML bookmark statements did not appear in the revised text above although they are visible in the WordPress.com text editor. There are two such name statements: one before the word ‘Hot’ in the line ‘Hot food is always piping’ and one before the word ‘Piping’ on the last line.
I’ll try pasting the two lines again. Here they are:
Hot food is always <span style=”text-decoration: underline;”>piping</span> hot
Piping: very hot. <span style=”text-decoration: underline;”>Return</span>
Ben
-
-
Hi Ben,
I’m afraid pasting your text here isn’t going to be effective. The forum deals with code differently than your site does, so what I see here won’t be what you get there. It’s easier for me just to look directly at your test post.
It looks like you removed all your hyperlinks from your test post. Those should actually come through fine. I recommend you try to paste a post with hyperlinks but no book marks and see if that works better.
As for bookmarks, I’m not sure they will come through cleanly as the way they are coded in Word may be different than the way they are coded in HTML. On the web they are called “Jumps” or “Anchors”. You can learn more about how they work here:
http://en.support.wordpress.com/splitting-content/page-jumps/
That having been said your “hot” and “piping” jumps are working the way I would expect based on the code you are using now. Did you expect something else?
-
Liz:
This is a direct reply rather than a forum reply. Look for … inserts in your text below. Ben
-
I’m afraid your response did not come through. Even though you replied to the e-mail, your response came back to the forum. Please post your full response in the reply section and I’ll be happy to follow up :)
-
Okay, here goes. In what follows, I’ve changed the HTML chevron symbols in the bookmark statements into square bracket symbols to defeat the automatic recognition and suppression of the HTML name statements in my reply.
Hi Ben,
I’m afraid pasting your text here isn’t going to be effective. The forum deals with code differently than your site does, so what I see here won’t be what you get there. It’s easier for me just to look directly at your test post.
<Ben> I’m not sure how to do this but here is the link to my bookmark/hyperlink test file on my site:
http://ben-bennetts.com/2015/02/19/bookmark-hyperlink-test
If that doesn’t work, here is what shows in the WordPress Editor’s text view:
Word marriages
Have you noticed:
[a name=”Hot”][/a]
Hot food is always <span style=”text-decoration:underline;”>piping</span> hotVistas and sunsets are always stunning
Revelations are always earth shattering
Flowers are always gorgeous
Journeys are always epic
Marriages are always made in heaven
Tomes are always weighty
Footage is always shocking
…
[a name=”Piping”][/a]
Piping: very hot. <span style=”text-decoration:underline;”>Return</span>———————————————————-
This seems to work as expected. I had to move the [a name …] statements to a new line above the ‘jump’ points to return to the correct position in the text plus I found out that the word between the quotation marks is case sensitive i.e. “Piping” instead of “piping”, but it all seems to be fine now. </Ben>
It looks like you removed all your hyperlinks from your test post. Those should actually come through fine. I recommend you try to paste a post with hyperlinks but no book marks and see if that works better.
<Ben> No, I didn’t remove the Word-inserted hyperlinks. They came through okay. I just added the [a name …] bookmark statements once I had the text in the WordPress text viewer. That worked once I figured out the case sensitivity and statement placement issues mentioned above. </Ben>
As for bookmarks, I’m not sure they will come through cleanly as the way they are coded in Word may be different than the way they are coded in HTML. On the web they are called “Jumps” or “Anchors”. You can learn more about how they work here:
http://en.support.wordpress.com/splitting-content/page-jumps/
<Ben> This is exactly what I was looking for and fills in the missing bits in my knowledge. The only difference between what I’ve done and what the article suggests is that I’ve used the [a name …] statement to position a bookmark whereas the article suggests I use the [a id …] statement. I’m not sure of the difference between these two statements as bookmark statements but I’ll continue to explore. </Ben>
That having been said your “hot” and “piping” jumps are working the way I would expect based on the code you are using now. Did you expect something else?
<Ben> No. It looks as if I have a solution that works. I’ll continue playing but thanks for all your help so far. </Ben>
-
- The topic ‘Preserve Word's bookmarks and hyperlinks in a WordPress post’ is closed to new replies.