| 13 | |
| 14 | |
| 15 | The only thing I have been able to do is add a filter to replace links to _wp_link_placeholder with links to the siteurl, and I added an error_log statement so that I am manually finding posts with this error, and then contacting editors individually notifying them they need to fix and learn this new way of doing it :( |
| 16 | |
| 17 | Here's a simple fix for at least preventing these links from showing up publically.. haven't found a fix for the editors yet. |
| 18 | |
| 19 | |
| 20 | |
| 21 | {{{#!php |
| 22 | <?php |
| 23 | function askapache_filter_link_placeholder( $content ) { |
| 24 | if ( isset( $content[10] ) && strpos( $content, '_wp_link_placeholder' ) !== false ) { |
| 25 | // remove links to /_wp_link_placeholder by replacing them with WP_SITEURL |
| 26 | return preg_replace( '#_wp_link_placeholder#', WP_SITEURL, $content ); |
| 27 | } |
| 28 | return $content; |
| 29 | } |
| 30 | add_filter( 'the_content', 'askapache_filter_link_placeholder' ); |
| 31 | add_filter( 'the_content_feed', 'askapache_filter_link_placeholder' ); |
| 32 | add_filter( 'get_the_content', 'askapache_filter_link_placeholder' ); |
| 33 | add_filter( 'the_excerpt', 'askapache_filter_link_placeholder' ); |
| 34 | add_filter( 'content_save_pre', 'askapache_filter_link_placeholder' ); |
| 35 | add_filter( 'excerpt_save_pre', 'askapache_filter_link_placeholder' ); |
| 36 | }}} |
| 37 | |
| 38 | |
| 39 | And then in `robots.txt` |
| 40 | |
| 41 | {{{ |
| 42 | Disallow: /_wp_link_placeholder |
| 43 | }}} |