Title: arobson13's Replies | WordPress.org

---

# arobson13

  [  ](https://wordpress.org/support/users/arobson13/)

 *   [Profile](https://wordpress.org/support/users/arobson13/)
 *   [Topics Started](https://wordpress.org/support/users/arobson13/topics/)
 *   [Replies Created](https://wordpress.org/support/users/arobson13/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/arobson13/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/arobson13/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/arobson13/engagements/)
 *   [Favorites](https://wordpress.org/support/users/arobson13/favorites/)

 Search replies:

## Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Anchor wrapped div created duplicate link](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/)
 *  Thread Starter [arobson13](https://wordpress.org/support/users/arobson13/)
 * (@arobson13)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/#post-2856119)
 * jnhghy, you are right, this is a grey area where if you do not know what you 
   are doing, it can have a drastic impact on other pages in your site.
 * However, since wordpress is a very intrusive CMS, it will be likely that any 
   corrections you make to the core files may fix errors generated by the wordpress
   core files.
 * If you make the edit manually, you will need to update wordpress manually, and
   make sure to include the edits/corrections you have implemented previously or“
   You’re gunna have a bad time”.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Anchor wrapped div created duplicate link](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/)
 *  Thread Starter [arobson13](https://wordpress.org/support/users/arobson13/)
 * (@arobson13)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/#post-2856008)
 * I edited the function _wpautop()_ which is located in _wp-includes/formatting.
   php_. After some hacking away, I appended the following line of code (line 224):
 *     ```
       $allblocks = '(?:a|table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
       ```
   
 * As you can see, I added the **a** tag to the beginning of the string. This function,
   with the append, will add the **p** tags and remove them before returning the
   content string around the block tags listed in the $allblocks string. This will
   also add a new-line-feed in the source code for the **a** open and close tag.
 * I am glad I was able to post the final fix. I hope this helps someone.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Anchor wrapped div created duplicate link](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/)
 *  Thread Starter [arobson13](https://wordpress.org/support/users/arobson13/)
 * (@arobson13)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/#post-2856004)
 * I guess I resolved the issue. I will have to edit the WordPress filters using
   the above link as a guide and remove the added <p> tag which causes the strange
   results.
 * Here is an answer as to the effect that is happening:
    [http://www.w3.org/TR/html5/syntax.html#syntax-tag-omission](http://www.w3.org/TR/html5/syntax.html#syntax-tag-omission)
 * > A p element’s end tag may be omitted if the p element is immediately followed
   > by an address, article, aside, blockquote, dir, div, dl, fieldset, footer, 
   > form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, menu, nav, ol, p, pre, section,
   > table, or ul, element, or if there is no more content in the parent element
   > and the parent element is not an a element.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Anchor wrapped div created duplicate link](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/)
 *  Thread Starter [arobson13](https://wordpress.org/support/users/arobson13/)
 * (@arobson13)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/#post-2855999)
 * Ok, so I broke it down to something completely weird. Has little to do with WordPress.
 * Open up a new .HTML document and enter the following code:
 *     ```
       <a href="unique">hello<p></a>
       ```
   
 * When you open it up and inspect element in Chrome or Firefox a duplicate link
   is created. Normally this would not be a problem since it doesn’t copy the anchor
   value and you can use CSS to hide the p tag for formatting.
 * Here is the Inspection results for both browsers: [http://imgur.com/bgZcs](http://imgur.com/bgZcs)
 * So my issue has to do with the creation of the <p> tag which was added for a 
   reason I must figure out. Perhaps the link above will now be of some use.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Anchor wrapped div created duplicate link](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/)
 *  Thread Starter [arobson13](https://wordpress.org/support/users/arobson13/)
 * (@arobson13)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/#post-2855998)
 * Strange. I didn’t notice this earlier, but the code is different when I view 
   the source and when I Inspect Element. This makes me think the links are being
   generated client side.
 * ‘Inspect element’ in Chrome:
 *     ```
       <a href="link.com"><br>
       <img>
       <div><span></span></div>
       </a>
       <p><a href="link.com"></a>
       </p>
       ```
   
 * ‘View Source’:
 *     ```
       <a href="link.com"><br />
       <img />
       <div><span></span></div>
       <p></a>
       ```
   
 * I am going to go through the scripts running. I came across this article but 
   it might not help. [http://www.gkspk.com/view/programming/stop-wordpress-adding-p-tags-in-code-elements/](http://www.gkspk.com/view/programming/stop-wordpress-adding-p-tags-in-code-elements/)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Anchor wrapped div created duplicate link](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/)
 *  Thread Starter [arobson13](https://wordpress.org/support/users/arobson13/)
 * (@arobson13)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/#post-2855994)
 * I don’t think this is being created by my theme. I have switched themes and the
   code is still duplicated.
 * The first link is created by PHP, and is supposed to loop through creating a 
   link for each animal. There is no where in my code where it would create the 
   extra link. And as I said above if i remove the embedded <div></div> tags the
   second link does not generate.
 * Thank you for your replies!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Anchor wrapped div created duplicate link](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/)
 *  Thread Starter [arobson13](https://wordpress.org/support/users/arobson13/)
 * (@arobson13)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/#post-2855986)
 * The following code is generated some how:
 *     ```
       <p>
       <a href="/mhs/wp-content/plugins/listgrid/petbio.php?id=666" rel="lightbox[Dog]" title="Test Dog" class="cboxElement"> </a>
       </p>
       ```
   
 * I would like it all removed, not just hidden.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Anchor wrapped div created duplicate link](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/)
 *  Thread Starter [arobson13](https://wordpress.org/support/users/arobson13/)
 * (@arobson13)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/anchor-wrapped-div-created-duplicate-link/#post-2855983)
 * Still working away. I will update if I find anything.
 * Google is being no help. This seems to be a very isolated incident, which makes
   me think there has to be something I am doing to cause WordPress to generate 
   this extra code.

Viewing 8 replies - 1 through 8 (of 8 total)