How to prevent WordPress loading external resources when developing

WordPress doesn’t have an option for restricting external content from loading in the browser.

Some resources such as fonts, or external scripts, can always be saved in the web root and served directly from there.

For resources that you cannot store locally (Gravatar images for example) you could consider Charles Proxy. Charles Proxy is a great application for debugging and shaping HTTP traffic. One of it’s many features includes Remote Mapping which would allow you to capture your external requests and serve a local fallback instead.

Charles Proxy – Map Remote