Title: WordPress Optimization &#8211; code hacks
Last modified: August 19, 2016

---

# WordPress Optimization – code hacks

 *  [Jan Reilink](https://wordpress.org/support/users/janr/)
 * (@janr)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/wordpress-optimization-code-hacks/)
 * For the fun and profit, I’m trying to improve (and speed-up) my WordPress blog.
   Beyond WP Super Cache I mean 😉
 * Because a browser (Internet Explorer, Firefox) can only make a limited number
   of HTTP requests simultaneous to a DNS host name, I added some to my website:
   img., css. and js. The plan is to load CSS files from css.mysite.tld and images
   from img.mysite.tld, you get the idea.
 * I have virtually no knowledge of the WordPress API, but for as far as I tried,
   this is a pain to do. Because you have to code-change every plug-in. For example:
 * * my Journalist theme: I added to functions.php:
 *     ```
       add_filter('stylesheet_uri', 'change_css');
       function change_css() { return "http://css.saotn.nl/wp-content/themes/journalist/style.css"; }
       ```
   
 * Unfortunately this does not work for added plug-ins, since `bloginfo('stylesheet_url')`
   is only for the current theme.
 * * One of the other changes I had to make was in one of my plug-ins “Secure and
   Accessible PHP Contact Form”:
 *     ```
       get_bloginfo('wpurl')
       ```
   
 * became
 *     ```
       str_replace("saotn.nl", "js.saotn.nl", get_bloginfo('wpurl'))
       ```
   
 * (I know, my PHP skills aren’t that good).
 * * And in WP-Syntax:
 *     ```
       $css_url = str_replace("saotn.nl", "css.saotn.nl",WP_PLUGIN_URL).'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__));
       ```
   
 * Is there a better way, with less code changes, to reduce HTTP requests? A general“
   CSS/JS URL Setting” in WordPress’ back-end would be nice 🙂

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

 *  Thread Starter [Jan Reilink](https://wordpress.org/support/users/janr/)
 * (@janr)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/wordpress-optimization-code-hacks/#post-1369708)
 * No one knows a better method?
 *  [Qurl](https://wordpress.org/support/users/qurl/)
 * (@qurl)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/wordpress-optimization-code-hacks/#post-1369709)
 * The only thing I can think of is using the Rewrite Engine from Apache.

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

The topic ‘WordPress Optimization – code hacks’ is closed to new replies.

## Tags

 * [wordpress optimization](https://wordpress.org/support/topic-tag/wordpress-optimization/)

 * 2 replies
 * 2 participants
 * Last reply from: [Qurl](https://wordpress.org/support/users/qurl/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/wordpress-optimization-code-hacks/#post-1369709)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
