How to increase wordpress memory limit

When some plugin or php code needs more memory than allocated in apache server you get a error like

  Fatal error: Allowed memory size of xxxxxx bytes exhausted (tried to allocate xxxxxx bytes) in /home/youruser/public_html/wp-includes/plugin.php on line xxx

To fix this you need increase wordpress memory usage by adding the following line in wp-config.php. This is located in the root of wordpress installation. And you can use FTP client or you can browse the cpanel file manager to edit wp-config and add the code.

  define( 'WP_MEMORY_LIMIT', '256M' );

You can increase it to 64M at first and if you still see the error you can increase it to any number it requires but your server has a memory limit available.