Sql Server Replication - Modify Statement Delivery Stored Procedures before the replication starts I want to create a subscriber (replica) where fields like Username, Email, and other personal customer info is masked (I'm creating a replica of production to help developers troubleshoot issues).

So I know that I should modify the sp_MSins_... and sp_MSupd_... procedures. But the problem is that these procedures exist in the subscriber (right?) so whenever I modify them and then reinitialize the replication to apply their logic to the existing data, the procedures get reverted to their initial state.  

I couldn't find anything online about how to handle this.
What are my options?
From docs:


  Default and custom stored procedures 
  
  The three procedures that
  replication creates by default for each table article are:
  
  sp_MSins_&lt; tablename >, which handles inserts.
  
  sp_MSupd_&lt; tablename >, which handles updates.
  
  sp_MSdel_&lt; tablename >, which handles deletes.
  
  The  used in the procedure depends on how the article was
  added to the publication and whether the subscription database
  contains a table of the same name with a different owner.
  
  Any of these procedures can be replaced with a custom procedure that
  you specify when adding an article to a publication. Custom procedures
  are used if an application requires custom logic, such as inserting
  data into an audit table when a row is updated at a Subscriber. For
  more information about specifying custom stored procedures, see the
  how to topics listed above.


Default and custom stored procedures

So you create the custom stored procedures in the subscriber database and configure the article to use them in sp_addarticle.