---
title: Enable WordPress Plugin, Theme Updates and Pretty Permalinks on Nginx
date: 2011-02-22T18:47:42+00:00
modified: 2012-05-19T15:42:50+00:00
permalink: https://kaspars.net/blog/enable-plugin-theme-updates-and-pretty-permalinks-nginx
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
post_tag:
  - Nginx
  - PHP
  - Snippet
category:
  - Web Performance
  - WordPress
---

# Enable WordPress Plugin, Theme Updates and Pretty Permalinks on Nginx

WordPress doesn’t know that your Nginx web server is capable of doing URL rewrites without `mod_rewrite` and Apache, so we explain that by adding:

```
add_filter('got_rewrite', 'nginx_has_rewrites');
function nginx_has_rewrites() {
	return true;
}
```

in your theme’s `functions.php`.

It is very likely that along Nginx you are also running PHP-FPM for all your PHP needs, and for some reason WordPress thinks its PHP process can’t write to disk. We tell WordPress that it can:

```
add_filter('filesystem_method', 'nginx_make_filesystem_direct');
function nginx_make_filesystem_direct() {
	return 'direct';
}
```