Title: Twig template &#8211; Deprecated &#8220;replace&#8221;
Last modified: May 12, 2017

---

# Twig template – Deprecated “replace”

 *  Resolved [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/twig-template-deprecated-replace/)
 * Hi,
 * It’s great plugin. I just received a PHP notice related to Twig. I see in QM (
   Query Monitor) this:
 * `Using "replace" with character by character replacement is deprecated since 
   version 1.22 and will be removed in Twig 2.0`
 * By my research, it’s old “replace” in `views/app/container.html.twig`. If I change“
   replace” there with `replace({' ': '-'})` then I don’t see PHP notice more. (
   [https://twig.sensiolabs.org/doc/2.x/filters/replace.html](https://twig.sensiolabs.org/doc/2.x/filters/replace.html))
    -  This topic was modified 9 years, 1 month ago by [Saša](https://wordpress.org/support/users/stodorovic/).

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

 *  [Peter Featherstone](https://wordpress.org/support/users/peterfeatherstone-1/)
 * (@peterfeatherstone-1)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/twig-template-deprecated-replace/#post-9126803)
 * Hi there,
 * You can ignore the deprecation notice as I have locked the Twig version due to
   them dropping support for PHP 5.5 in later versions and so wont be upgrading 
   it. 🙂
 * Hope that helps
 * Peter
 *  Thread Starter [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/twig-template-deprecated-replace/#post-9128211)
 * Hi Peter,
 * I’m ignoring the deprecation notice (it’s on each page), but it’s boring (for
   developers) when more plugins trigger some notices. It’s easier to see mistakes
   in my code if other plugins don’t trigger notices.
 * It’ll be nice if you update the code (in one of next releases), I already made
   simple PR (github) and you can see what I meant. 🙂
 * It works in current version without notice (Twig) and it’ll work in newer versions.
 * There are more “replaces” into `views/admin/macros.html.twig`, but it affects
   only plugin settings (I mean only one page). I’ll make PR (and I’ll do more tests)
   for it in next days. As I said, it’s great plugin and I want to give my minor
   contribution. 🙂
 * Sasa
 *  [Peter Featherstone](https://wordpress.org/support/users/peterfeatherstone-1/)
 * (@peterfeatherstone-1)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/twig-template-deprecated-replace/#post-9128240)
 * Hey Sasa,
 * I very much appreciate that and I only meant ignore it for now as I was going
   go fix it for you for the next release.
 * Thanks very much for the PR. Once all instances are covered I’ll merge it in 
   🙂
 * Thanks again
 * Peter

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

The topic ‘Twig template – Deprecated “replace”’ is closed to new replies.

 * ![](https://ps.w.org/responsive-menu/assets/icon-256x256.png?rev=1782326)
 * [Responsive Menu - Create Mobile-Friendly Menu](https://wordpress.org/plugins/responsive-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/responsive-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/responsive-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/responsive-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/responsive-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/responsive-menu/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Peter Featherstone](https://wordpress.org/support/users/peterfeatherstone-1/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/twig-template-deprecated-replace/#post-9128240)
 * Status: resolved