New answers tagged

1

Inspired by @Samuel Elh, but accounting for single or double quoted attributes and a href that might not be the first attribute of an anchor: function wpse_227315_strip_hyperlinks( $content ) { preg_match_all( '!<a[^>]*? href=[\'"]#[^<]+</a>!i', $content, $matches ); foreach ( $matches[0] as $link ) $content = str_replace( ...


1

Try this function: function wpse_227315_strip_hyperlinks( $content ) { preg_match_all( '/<a href=\\"([^\\"]*)\\">(.*)<\\/a>/iU', $content, $matches ); foreach( $matches[0] as $link ) { preg_match_all('/(?<=href=\").+(?=\")/', $link, $matches2); $href = isset( $matches2[0][0] ) ? $matches2[0][0] : false; ...


1

You can use the Interconnectit DB Search/Replace Tool to search and replace all instances of strings in your database. This may not fully solve your problem, but you could start with searching for <a href="# and replacing it with <a href=". I don't think that's exactly what you're trying to do, but hopefully it's a start in the right direction.


0

I found the text and changed it directly from the database (PHPmyadmin), in the table "wp_posts", in the field ID 2, column "post_content". I hope it helps !


2

You need to use Open Graph meta markup to have this type of sharing on Facebook .There are so many plugins available in the WordPress repository for this. For example: <meta property="og:url" content="http://sharing/url" /> <meta property="og:type" content="article" /> <meta property="og:title" content="Title of the post" /> <meta ...



Top 50 recent answers are included