Paths wordpress is listening on

Good day everyone!

I got a site on wordpress and I want to disable any possible URLs to access/post info on it except some legal. I printed $wp_rewrite->rewrite_rules() (or something like that, I got no code now to point at exactly) and see many paths which are accessible from outside.

Are there any other ways to determine all paths available on my site? Maybe there's a nice tool to use or doc about that?


There is no rewrite table in Wordpress like you might see in other CMS platfroms. The rewrite URLs are generated dynamically based on your permalink settings and the slug/meta for a given post. If you are trying to find a list of the URLs you should probably try a sitemap generating plugin before writing something yourself.

If you are trying to find a list of the rules that Wordpress is using you can simply use the rewrite_rules_array filter like so:

function dump_rewrites($rules){
add_filter('rewrite_rules_array', 'dump_rewrites');

This will exit the PHP process and print the rules on the webpage.

Tags: PHP / Wordpress

Similar questions

Change wordpress wp-content/uploads/ paths to load from 2 different hard disk in the same server
Change wordpress wp-content/uploads/ paths to load from 2 different hard disk in the same server So basically there only 1 machine with 2 hard drives now my dev/mapper is full with images /wp-content/uploads how i make wordpress save to the other hard drive from now on but still be able to use the old images from old hard drive
Changing paths to images in Wordpress
I recently moved a friends blog onto his new web hosts but unfortunately the images are not working. This is due to the old host having the following path for images: The new host uses a different layout and has this path for the file:
Why is my WordPress PHP header template generating oddly coded paths and transcluding some css and js file in the outputted HTML?
I think this is an encoding problem(?), but not really sure. When I view my generated source (in both FF and IE) I see funky paths from my js and css files like: <script type="text/javascript" src=",oeasing,omin,l.js"></script> Also, several of ...
Wordpress development - local and remote paths
I'm trying to set up wordpress so that relative paths work on both my localhost development and my live site. I was hoping it was just a matter of changing the "site" URL and "home" URL to http://localhost/ and, and then links would be relative. However this is not the case, and I think .htaccess complicates the issue. Eg, if I want...
How do I make XAMPP use the paths from my Wordpress themes folder?
I'm having an issue where I have a local Wordpress install on my Ubuntu machine using XAMPP and I'm trying to work on a theme from scratch. The problem is that any path in index.php that's supposed to refer to other files in the same folder (e.g. <link rel="stylesheet type="text/css" href="style.css">) is supposed to point to the CSS file in ...
WordPress paths with GLOB PHP
hi I am using the code below to try and read a directory and display all the JPEGs from it but thanks to WordPress paths i'm coming unstuck: So in my theme directory i have a folder called homepageBottomPictures with JPEGs in them. What can i do? (At the moment, nothing is returned to $files)

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.