When creating a post within my wordpress site (using the editor) I want to add the short code, or even use the link at the top of the editor to do so.

The end result is (it does create the excerpt and add the "Read more" link) but that link is broken and the editor has seemingly inserted a
tag within my anchor breaking the link.

<a href="http://www.seekersolutions.com&lt;br /&gt; /a-test-post/" class="more-link">Read more »</a>

Anyone have an idea as to why this would be happening?

  • You wouldn't happen to have a line break in your URL would you? Does this happen with a default theme (Twenty Twelve) with all of your plugins disabled? – s_ha_dum May 16 '13 at 18:06
  • Thanks for that tip, I had a look at the permalink structure and it turns out there is a space right after the end of my url. I have checked my database there is no space appended on any of the columns in the wp_options table. Any ideas as to where this could be coming from? – Brandon Ellis May 16 '13 at 18:10

Because of the way that wpautop works, I would expect that if you had a newline, or or maybe a space in your URL. I can't seem to get a space or newline to save from the admin interface, but it is trivial to insert by editing the WP_HOME and WP_SITEURL constants into wp-config.php... but that causes every page to 404 or worse.

There must be something happening when the link is generated-- possibly something hooked to excerpt_more or the_content_more_link. It is also possible that your theme is parsing the more link itself and bypassing the normal channels.

Without more information, that is all I have.



  • In addition to this, in the WP_OPTIONS table, even though I cleared any white space in the table the interface was no removing the <br> UNTIL I changed the URL completely. Once I did that the space was removed and I was able to correctly add my normal URL back to the database without the space. – Brandon Ellis May 16 '13 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.