How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes '&' to '#038;'?

I use a quick redirects plugin and it's changing my URLs after the fact and thereby breaking some of my links. I never want wordpress to change to #038;.

There is an unwanted solution to turn off all wp_texturize by placing:

remove_filter('the_content', 'wptexturize');

I don't want to disable everything, just the conversion in URLs.

I can physically modify wp-includes/formatting.php by commenting out this line, but it didn't work:

$content = preg_replace('/([^#])(?![a-z1-4]{1,8};)/i', '#038;$1', $content);

I don't want to do that even if it did work, which it didn't, otherwise I'd have to do it again on every wp upgrade. But actually I tried it and it didn't fix it.

For now I added a 301 redirect into htaccess which worked.

What is a permanent line of code to add to functions.php to permanently disable wordpress modifying to #038;?

Topic functions url-rewriting php urls redirect Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.