• I am using WP2Static 6.6.7 on WordPress 5.3.2 (corporate client does not want to update – no need really when using WP2Static). Pushing to S3.
    I am also using Polylang and I have translated a few pages into Irish (/ga prefix).

    Until we are ready to deploy I want to exclude the /ga pages.
    The initial crawl list correctly shows that they are excluded but then the deploy includes them.

    I also tried this with 6.6.20 (hence the 2 add_filter calls) and pushed to zip file and had the same issue.
    I did delete the deploy cache before doing static site export.

    What am I doing wrong?

    <?php
    add_filter( 'statichtmloutput_modify_initial_crawl_list', 'dcwd_omit_irish_from_crawl_list' );
    add_filter( 'wp2static_modify_initial_crawl_list', 'dcwd_omit_irish_from_crawl_list' );
    function remove_ga_url( $url ) {
        // Return whether the url has /ga/ - verbose code to aid source code debugging.
    	if ( false === strpos( $url, '/ga/' ) ) {
    		return true;
    	}
    	else {
    		return false;
    	}
    }
    function dcwd_omit_irish_from_crawl_list( $url_queue ) {
    	$url_queue = array_filter( $url_queue, 'remove_ga_url' );
    	error_log( 'URL Queue after:' . var_export( $url_queue, true ) );
    	return $url_queue;
    }
  • The topic ‘Excluded urls still deployed’ is closed to new replies.